#include <bits/stdc++.h>
using namespace std;
struct T {
  long long int x;
  int y;
} a[1000000];
int h[1000000];
bool comp(T i, T j) {
  if (i.x > j.x)
    return true;
  else
    return false;
}
int main() {
  int n, k;
  long long int money;
  scanf("%d%d", &n, &k);
  cin >> money;
  for (int i = 0; i < n; i++) {
    cin >> a[i].x;
    a[i].y = i;
    h[i] = 0;
  }
  sort(a, a + n - 1, comp);
  long long int sum = 0;
  for (int i = 0; i < k; i++) {
    sum += a[i].x;
    h[a[i].y] = 1;
  }
  int ans = n - 1;
  long long int money_spent;
  for (int i = 0; i < k; i++) {
    money_spent = sum;
    if (money - money_spent < 0) ans = min(ans, a[i].y);
  }
  for (int i = k; i < n; i++) {
    money_spent = sum - a[k - 1].x + a[i].x;
    if (money - money_spent < 0) ans = min(ans, a[i].y);
  }
  cout << ans + 1 << endl;
  return 0;
}
