#include <bits/stdc++.h>
using namespace std;
struct node {
  int v, b;
};
node a[100100];
int cmp(node x, node y) {
  if (x.v == y.v) return x.b < y.b;
  return x.v < y.v;
}
int main() {
  int n, k;
  long long b;
  scanf("%d%d%lld", &n, &k, &b);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].v);
    a[i].b = i;
  }
  sort(a + 1, a + n, cmp);
  long long sum = 0;
  int bit = 1 << 30;
  for (int i = n - 1; i >= n - k; i--) {
    sum = sum + a[i].v;
    bit = min(bit, a[i].b);
  }
  if (sum <= b) {
    printf("%d\n", n);
    return 0;
  }
  for (int i = n - k - 1; i > 0; i--) {
    sum = sum - a[i + 1].v;
    sum = sum + a[i].v;
    if (sum > b) {
      bit = min(bit, a[i].b);
    }
  }
  printf("%d\n", bit);
  return 0;
}
