//#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
#define ent "\n"
#define int long long
#define f first
#define s second

const int maxn = 2e5 + 100;
const int inf = (int)1e9 + 100;
const ll INF = (ll)1e18;
const int MOD = 1e9 + 7;
const int maxl = 20;
const ll P = 31;

int sz;
int n, q, k;
int a[maxn];
int p[maxn];
int root[maxn];
int l[maxn];
int r[maxn];
int d[maxn * 22];
int L[maxn * 22];
int R[maxn * 22];

int build(int tl = 1, int tr = n){
    int v = ++sz;
    if(tl != tr){
        int mid = (tl + tr) >> 1;
        L[v] = build(tl, mid);
        R[v] = build(mid+1, tr);
    }
    return v;
}

int copy(int v){
    int nv = ++sz;
    d[nv] = d[v];
    L[nv] = L[v];
    R[nv] = R[v];
    return nv;
}

int upd(int i, int v, int tl = 1, int tr = n){
    int nv = copy(v);
    if(tl == tr){
        d[nv] = 1;
    } else{
        int mid = (tl + tr) >> 1;
        if(i <= mid){
            L[nv] = upd(i, L[nv], tl, mid);
        } else{
            R[nv] = upd(i, R[nv], mid+1, tr);
        }
        d[nv] = d[L[nv]] + d[R[nv]];
    }
    return nv;
}

int get(int i, int v, int tl = 1, int tr = n){
    if(tl == tr) return tl;
    int mid = (tl + tr) >> 1;
    if(d[L[v]] >= i) return get(i, L[v], tl, mid);
    else return get(i - d[L[v]], R[v], mid+1, tr);
}

void test(){
    cin >> n >> q >> k;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        p[a[i]] = i;
    }
    root[0] = build();
    for(int i = 1; i <= n; i++){
        root[i] = upd(a[i], root[i-1]);
    }
    for(int i = 1; i <= q; i++){
        cin >> l[i] >> r[i];
    }
    for(int i = q; i > 0; i--){
        if(k < l[i]) continue;
        if(r[i] < k) continue;
        int len = r[i] - l[i] + 1;
        k = p[get(k - l[i] + 1, root[len])] + l[i] - 1;
    }
    cout << k;
}

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    int t; t = 1;
    while(t--) test();
}
