#include <bits/stdc++.h>
using namespace std;
int k, n;
long long b;
long long sum;
int a[100005];
int pos[100005];
bool flag;
bool f[100005];
int comp(const void *x, const void *y) { return a[*(int *)y] - a[*(int *)x]; }
int main() {
  scanf("%d %d", &n, &k);
  scanf("%I64d", &b);
  flag = false;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    pos[i] = i;
    f[i] = false;
  }
  qsort(pos, n - 1, sizeof(int), comp);
  for (int i = 0; i < k - 1; i++) {
    sum += a[pos[i]];
    f[pos[i]] = true;
    if (sum >= b) {
      flag = true;
      break;
    }
  }
  int ans = n;
  if (k >= 2) {
    bool found = false;
    for (int i = 0; i < n - 1; i++) {
      if (!f[i] && sum + a[i] > b) {
        ans = i;
        found = true;
        break;
      }
    }
    if (found) {
      for (int i = 0; i < k - 1; i++) {
        if (pos[i] < ans) ans = pos[i];
      }
      ans++;
    }
  } else {
    for (int i = 0; i < n - 1; i++) {
      if (a[i] > b) {
        ans = i + 1;
        break;
      }
    }
  }
  if (flag)
    printf("1\n");
  else
    printf("%d\n", ans);
  return 0;
}
