#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const long long LLINF = 9223372036854775807LL;
const int maxn = 100010;
int a[maxn] = {};
int order[maxn] = {};
int bad[maxn] = {};
bool cmp(int i1, int i2) { return a[i1] < a[i2]; }
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  long long b;
  cin >> b;
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  for (int i = 0; i < n - 1; ++i) order[i] = i;
  sort(order, order + n - 1, cmp);
  reverse(order, order + n - 1);
  long long sum = 0;
  for (int i = 0; i < k - 1; ++i) bad[order[i]] = 1, sum += a[order[i]];
  long long sum2 = sum + a[order[k - 1]];
  for (int i = 0; i < n - 1; ++i) {
    long long need = b - a[i] + 1;
    long long cursum = sum;
    if (bad[i]) cursum = sum2 - a[i];
    if (cursum >= need) {
      printf("%d\n", i + 1);
      exit(0);
    }
  }
  printf("%d\n", n);
  return 0;
}
