#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0;
  int flag = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') flag = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return ~flag ? x : -x;
}
using ll = long long;
pair<int, int> sq[100005];
int main() {
  int n, k;
  ll m;
  scanf("%d%d", &n, &k);
  scanf("%I64d", &m);
  for (int i = 1; i < n; i++) {
    sq[i] = {read(), i};
  }
  sort(sq + 1, sq + n, [](pair<int, int> &a, pair<int, int> &b) {
    if (a.first == b.first) return a.second < b.second;
    return a.first > b.first;
  });
  int knum = sq[k].first;
  sort(sq + 1, sq + k + 1, [](pair<int, int> &a, pair<int, int> &b) {
    return a.second < b.second;
  });
  sort(sq + k + 1, sq + n, [](pair<int, int> &a, pair<int, int> &b) {
    return a.second < b.second;
  });
  ll sum = 0;
  for (int i = 1; i <= k; i++) {
    sum += sq[i].first;
  }
  if (sum <= m)
    printf("%d\n", n);
  else {
    int ans = sq[1].second;
    for (int i = k + 1; i < n; i++) {
      if (sq[i].second < ans) {
        if (sum - knum + sq[i].first > m) ans = sq[i].second;
      } else
        break;
    }
    printf("%d\n", ans);
  }
  return 0;
}
