#include <bits/stdc++.h>
using namespace std;
const int N = 100009;
struct str {
  int x, i;
  void in(int _i) {
    i = _i;
    cin >> x;
  }
} a[N];
bool cmp(str A, str B) { return (A.x > B.x || (A.x == B.x && A.i > B.i)); }
int ans, n, m, i;
long long b;
int main() {
  cin >> n >> m >> b;
  for (i = 1; i <= n; i++) a[i].in(i);
  sort(a + 1, a + n, cmp);
  ans = n;
  for (i = 1; i <= m; i++) {
    if (i < m) {
      if (a[i].x >= b) {
        cout << 1;
        return 0;
      } else {
        b -= a[i].x;
        ans = min(ans, a[i].i);
      }
    } else {
      if (a[i].x > b) {
        while (a[i].x > b && i < n) {
          ans = min(ans, a[i].i);
          i++;
        }
        i--;
        cout << ans;
      } else
        cout << n;
      return 0;
    }
  }
}
