#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5;
long long d[N], e[N];
long long d_pref_min[N], e_pref_min[N];
long long dn = 0, en = 0;
pair<long long, long long> d_gadgets_pref_sum[N], e_gadgets_pref_sum[N];
long long n, m, k, s;
bool f(long long days, long long *d_cnt = nullptr, long long *e_cnt = nullptr) {
  long long d_mn = d_pref_min[days - 1];
  long long e_mn = e_pref_min[days - 1];
  if (k <= dn && d_gadgets_pref_sum[k - 1].first * d_mn <= s) {
    if (d_cnt && e_cnt) *d_cnt = k, *e_cnt = 0;
    return true;
  }
  if (k <= en && e_gadgets_pref_sum[k - 1].first * e_mn <= s) {
    if (d_cnt && e_cnt) *d_cnt = 0, *e_cnt = k;
    return true;
  }
  for (long long i = 0, j = en - 1; i < dn && j >= 0; i++) {
    while (d_gadgets_pref_sum[i].first * d_mn +
                   e_gadgets_pref_sum[j].first * e_mn >
               s &&
           j >= 0)
      j--;
    if (d_gadgets_pref_sum[i].first * d_mn +
                e_gadgets_pref_sum[j].first * e_mn <=
            s &&
        i + j + 2 >= k && j >= 0) {
      if (d_cnt && e_cnt) {
        *d_cnt = i + 1;
        *e_cnt = j + 1;
      }
      return true;
    }
  }
  return false;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> m >> k >> s;
  for (long long i = 0; i < n; i++) {
    cin >> d[i];
    d_pref_min[i] = d[i];
    if (i) d_pref_min[i] = min(d_pref_min[i], d_pref_min[i - 1]);
  }
  for (long long i = 0; i < n; i++) {
    cin >> e[i];
    e_pref_min[i] = e[i];
    if (i) e_pref_min[i] = min(e_pref_min[i], e_pref_min[i - 1]);
  }
  for (long long i = 0; i < m; i++) {
    long long t, c;
    cin >> t >> c;
    if (t == 1) {
      d_gadgets_pref_sum[dn++] = make_pair(c, i);
    } else {
      e_gadgets_pref_sum[en++] = make_pair(c, i);
    }
  }
  sort(d_gadgets_pref_sum, d_gadgets_pref_sum + dn);
  sort(e_gadgets_pref_sum, e_gadgets_pref_sum + en);
  for (long long i = 1; i < dn; i++) {
    d_gadgets_pref_sum[i].first += d_gadgets_pref_sum[i - 1].first;
  }
  for (long long i = 1; i < en; i++) {
    e_gadgets_pref_sum[i].first += e_gadgets_pref_sum[i - 1].first;
  }
  long long l = 1, r = n + 1;
  while (r - l > 2) {
    long long mid = (l + r) / 2;
    if (f(mid))
      r = mid + 1;
    else
      l = mid;
  }
  while (l < r) {
    if (f(l)) break;
    l++;
  }
  if (l == r)
    cout << -1 << endl;
  else {
    cout << l << endl;
    long long id = min_element(d, d + l) - d;
    long long ie = min_element(e, e + l) - e;
    long long *d_cnt = new long long;
    long long *e_cnt = new long long;
    f(l, d_cnt, e_cnt);
    for (long long i = 0; i < *d_cnt; i++) {
      cout << d_gadgets_pref_sum[i].second + 1 << " " << id + 1 << endl;
    }
    for (long long i = 0; i < *e_cnt; i++) {
      cout << e_gadgets_pref_sum[i].second + 1 << " " << ie + 1 << endl;
    }
    delete d_cnt;
    delete e_cnt;
  }
  return 0;
}
