#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>

using namespace std;
using ll = long long;

vector<int> a;

void srt(vector<int>& p, int l, int r) {
	l--;
	r--;
	map<int, int> pr;
	for (int i = l; i <= r; ++i) {
		pr[p[i - l]] = a[i];
	}
	int i = l;
	for (auto it : pr) {
		a[i] = it.second;
		i++;
	}
}

int main()
{
	int n, q, k;
	cin >> n >> q >> k;
	a.resize(n);
	for (int i = 0; i < n; ++i) {
		a[i] = i + 1;
	}
	vector<int> p(n);
	for (int i = 0; i < n; ++i) {
		cin >> p[i];
	}
	for (int i = 0; i < q; ++i) {
		int l, r;
		cin >> l >> r;
		srt(p, l, r);
		
	}

	cout << a[k - 1];
}