#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:65777216")
using namespace std;
const int N = 111111;
const int INF = 111111111;
const double eps = 1e-9;
const double pi = 3.14159265358979;
int n, k, a[N];
bool u[N];
long long s, smax;
pair<int, int> b[N];
int main() {
  scanf("%d%d", &n, &k);
  scanf("%I64d", &s);
  long long sum = 0;
  for (int i = 0; i < (n); i++) scanf("%d", &a[i]);
  for (int i = 0; i < (n); i++) b[i] = make_pair(a[i], i);
  sort(b, b + n - 1);
  reverse(b, b + n - 1);
  for (int i = 0; i < (k - 1); i++) {
    smax += b[i].first;
    u[b[i].second] = 1;
  }
  for (int i = 0; i < (n); i++) {
    long long t = smax;
    if (u[i]) t = t - a[i] + b[k - 1].first;
    if (t + a[i] > s) {
      printf("%d\n", i + 1);
      return 0;
    }
  }
  printf("%d\n", n);
  return 0;
}
