#include <bits/stdc++.h>
using namespace std;
int ix[100000 + 5];
int cost[100000 + 5];
int posInSort[100000 + 5];
int n, k;
long long S;
long long sumk, sumk_1;
bool cmp(const int &a, const int &b) {
  if (cost[a] != cost[b]) return cost[a] > cost[b];
  return a > b;
}
bool check(int ind) {
  long long paid = sumk_1;
  if (posInSort[ind] < k - 1) paid = sumk - cost[ind];
  return S - paid < cost[ind];
}
int main() {
  FILE *in = stdin;
  int c, c2;
  fscanf(in, "%d%d", &n, &k);
  fscanf(in, "%I64d", &S);
  for (c = 0; c < n; c++) {
    fscanf(in, "%d", &cost[c]);
    ix[c] = c;
  }
  sort(ix, ix + n - 1, cmp);
  for (c = 0; c < n; c++) posInSort[ix[c]] = c;
  sumk = sumk_1 = 0;
  for (c = 0; c < k - 1; c++) sumk_1 += cost[ix[c]];
  sumk = sumk_1 + cost[ix[k - 1]];
  for (c = 0; c < n - 1; c++)
    if (check(c)) break;
  printf("%d\n", c + 1);
  return 0;
}
