#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, k;
long long m, sum, cur_sum, val[N];
pair<long long, int> arr[N];
bool vis[N];
int main() {
  scanf("%d %d %I64d", &n, &k, &m);
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &val[i]);
    if (i < n - 1) arr[i].first = val[i], arr[i].second = i;
  }
  sort(arr, arr + n - 1), reverse(arr, arr + n - 1);
  for (int i = 0; i < k - 1; i++) vis[arr[i].second] = 1, sum += arr[i].first;
  for (int i = 0; i < n; i++) {
    cur_sum = sum;
    if (vis[i]) cur_sum -= val[i], cur_sum += arr[k - 1].first;
    if (m - cur_sum < val[i]) {
      printf("%d", i + 1);
      return 0;
    }
  }
  printf("%d", n);
  return 0;
}
