#include <bits/stdc++.h>   using namespace std;   const int N = 100005;   int n, k;   pair<int, int> a[N];   long long b, s;   int main() {     cin >> n >> k;     cin >> b;     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i].first);       a[i].second = i;     }     sort(a + 1, a + n, greater<pair<int, int> >());     for (int i = 1; i <= k; i++) s += a[i].first;     long long res = n;     if (s > b)       for (int i = 1; i <= k; i++) res = min(res, (long long)a[i].second);     for (int i = k + 1; i < n; i++)       if (s - a[k].first + a[i].first > b) res = min(res, (long long)a[i].second);     cout << res << endl;     return 0;   }   