#include <bits/stdc++.h>
using namespace std;
const double esp = 1e-8;
const int maxn = 100007;
long long a[maxn], sum, n, m, b[maxn];
bool cmp(const long long &x, const long long &y) { return a[x] > a[y]; }
int main() {
  while (scanf("%I64d %I64d", &n, &m) != EOF) {
    long long mm = 0;
    scanf("%I64d", &sum);
    for (int i = 1; i <= n; i++) {
      scanf("%I64d", &a[i]);
      b[i] = i;
      if (i == n) a[i] = 0;
    }
    if (n == 1) {
      printf("1\n");
      continue;
    }
    sort(b + 1, b + n, cmp);
    long long ans = n;
    long long data = 0;
    for (int i = 1; i < m; i++) data += a[b[i]];
    int i;
    for (i = 1; i < m; i++)
      if (a[b[i]] > sum - data - a[b[m]] + a[b[i]]) ans = min(ans, b[i]);
    if (i == m)
      for (i = m; i < n; i++)
        if (a[b[i]] > sum - data) ans = min(ans, b[i]);
    printf("%d\n", ans);
  }
  return 0;
}
