#include <bits/stdc++.h>
using namespace std;
int n, k, a[111111], b[111111], kk;
bool w[111111];
long long m, s, cur;
bool cmp(int x, int y) { return a[x] > a[y]; }
int main() {
  scanf("%d %d %I64d", &n, &k, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
    b[i] = i;
  }
  sort(b, b + n - 1, cmp);
  memset(w, 0, sizeof(w));
  kk = k - 1;
  s = 0;
  for (int i = 0; i < kk; ++i) {
    w[b[i]] = true;
    s += a[b[i]];
  }
  --n;
  for (int i = 0; i < n; ++i) {
    cur = s;
    if (w[i]) cur = cur - a[i] + a[b[kk]];
    if (cur + a[i] > m) {
      printf("%d", i + 1);
      return 0;
    }
  }
  printf("%d", n + 1);
  return 0;
}
