#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) {
  if (x == 0) return y;
  return gcd(y % x, x);
}
long long powmod(long long x, long long y, long long m) {
  if (y == 0) return 1;
  long long p = powmod(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
long long mul_inv(long long a, long long b) {
  long long b0 = b, t, q;
  long long x0 = 0ll, x1 = 1ll;
  if (b == 1ll) return 1ll;
  while (a > 1ll) {
    q = a / b;
    t = b, b = a % b, a = t;
    t = x0, x0 = x1 - q * x0, x1 = t;
  }
  if (x1 < 0ll) x1 += b0;
  return x1;
}
bool fa(vector<long long> &x, vector<long long> &y) { return x[0] < y[0]; }
bool fa1(vector<long long> &x, vector<long long> &y) { return x[1] < y[1]; }
bool f1(pair<long long, long long> &x, pair<long long, long long> &y) {
  return x.second > y.second;
}
bool f2(pair<long long, long long> &x, pair<long long, long long> &y) {
  return x.first > y.first;
}
bool f3(long long &x, long long &y) { return x > y; }
const long long maxn = 1 << 19;
vector<long long> seg(maxn + maxn, 0ll);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  long long m;
  cin >> m;
  long long b[n];
  for (int i = 0; i < n; i++) cin >> b[i];
  if (b[0] > m) {
    cout << 1;
    exit(0);
  }
  vector<array<long long, 2> > c;
  for (int i = 0; i < n - 1; i++) {
    c.push_back({b[i], i});
  }
  sort(c.begin(), c.end());
  long long s = 0;
  set<array<long long, 2> > d;
  long long cnt = 0;
  for (long long i = c.size() - 1; i >= 0; i--) {
    if (cnt == k) {
      break;
    }
    s += c[i][0];
    d.insert(c[i]);
    cnt++;
  }
  long long ans = n;
  for (int i = 0; i < n; i++) {
    array<long long, 2> temp = {b[i], i};
    if (d.find(temp) == d.end()) {
      long long h = s - (*d.begin())[0] + b[i];
      if (h > m) {
        ans = i + 1;
        break;
      }
    } else {
      if (s > m) {
        ans = i + 1;
        break;
      }
    }
  }
  cout << ans << "\n";
  return 0;
}
