#include <bits/stdc++.h>
double const PI = 4 * atan(1);
using namespace std;
void OPEN() {
  freopen("A.in", "r", stdin);
  freopen("A.out", "w", stdout);
}
int n, k;
long long M;
long long a[100111], b[100111], tong1 = 0, tong2 = 0;
int main() {
  scanf("%d %d", &n, &k);
  scanf("%I64d", &M);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    b[i] = a[i];
  }
  sort(b + 1, b + n);
  for (int i = n - 1; i > n - k; i--) {
    tong1 += b[i];
    tong2 += b[i];
  }
  tong1 += b[n - k];
  if (tong1 <= M) {
    cout << n;
    return 0;
  } else {
    for (int i = 1; i < n; i++) {
      if (a[i] >= b[n - k]) {
        cout << i;
        return 0;
      } else if (a[i] + tong2 > M) {
        cout << i;
        return 0;
      }
    }
  }
}
