#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100050;
int n, k;
long long b, A[MAXN];
bool used[MAXN];
vector<pair<long long, int>> V;
int main() {
  while (scanf("%d %d", &n, &k) >= 1) {
    memset(used, false, sizeof used);
    V.clear();
    scanf("%lld", &b);
    for (int i = (0); i < (int)(n); i++) {
      scanf("%lld", &A[i]);
      if (i < n - 1) {
        V.push_back({A[i], i});
      }
    }
    sort(V.begin(), V.end());
    reverse(V.begin(), V.end());
    long long s = 0, cachito = 0;
    for (int i = (0); i < (int)(V.size()); i++) {
      if (i == k - 1) {
        cachito = V[i].first;
        break;
      }
      used[V[i].second] = true;
      s += V[i].first;
    }
    bool ok = false;
    for (int i = (0); i < (int)(n); i++) {
      long long ns = s;
      if (used[i]) ns = ns + cachito - A[i];
      long long v = b - ns;
      if (A[i] > v) {
        printf("%d\n", i + 1);
        ok = true;
        break;
      }
    }
    if (!ok) {
      printf("%d\n", n);
    }
  }
  return 0;
}
