#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int v[maxn], b[maxn];
int n, k;
long long base, sum;
int cmp(const int &i, const int &j) { return i > j; }
int main() {
  while (scanf("%d %d", &n, &k) != EOF) {
    scanf("%I64d", &base);
    sum = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d", &v[i]);
      if (i != n - 1) b[i] = v[i];
    }
    sort(b, b + n - 1, cmp);
    int ans = n;
    for (int i = 0; i < k; i++) sum += b[i];
    for (int i = 0; i < n; i++) {
      int s = lower_bound(b, b + n - 1, v[i], cmp) - b;
      long long now = sum;
      if (s >= k) {
        now += v[i];
        now -= b[k - 1];
      }
      if (now > base) {
        ans = i + 1;
        break;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
