#include <bits/stdc++.h>
using namespace std;
const int iinf = 1e9 + 7;
const long long linf = 1ll << 60;
const double dinf = 1e10;
template <typename T>
inline void scf(T &x) {
  bool f = 0;
  x = 0;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') {
    f = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  if (f) x = -x;
  return;
}
template <typename T1, typename T2>
void scf(T1 &x, T2 &y) {
  scf(x);
  return scf(y);
}
template <typename T1, typename T2, typename T3>
void scf(T1 &x, T2 &y, T3 &z) {
  scf(x);
  scf(y);
  return scf(z);
}
const int N = 1e5 + 100;
using pli = pair<long long, int>;
int n, k;
long long b, a[N];
pli sqr[N];
bool used[N];
int main() {
  scf(n, k, b);
  for (int i = (1); i <= (n); i++) scf(a[i]), sqr[i] = make_pair(a[i], i);
  sort(sqr + 1, sqr + n);
  reverse(sqr + 1, sqr + n);
  for (int i = (1); i <= (k - 1); i++)
    used[sqr[i].second] = 1, b -= sqr[i].first;
  for (int i = (1); i <= (n - 1); i++) {
    long long lft = b;
    if (used[i]) lft -= sqr[k].first - a[i];
    if (lft < a[i]) {
      printf("%d\n", i);
      return 0;
    }
  }
  printf("%d\n", n);
  return 0;
}
