#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long n, m, k, s;
long long low, mid, high;
long long amin[N], bmin[N];
long long aminid[N], bminid[N];
long long a[N], b[N], ans = 0;
struct node {
  long long t, c, id, cost;
} ob[N];
bool cmp(node xx, node yy) { return xx.cost < yy.cost; }
bool ok(long long days) {
  long long totcost = 0;
  for (register long long i = 1; i <= m; i++) {
    if (ob[i].t == 1) {
      ob[i].cost = amin[days] * ob[i].c;
    } else {
      ob[i].cost = bmin[days] * ob[i].c;
    }
  }
  sort(ob + 1, ob + m + 1, cmp);
  for (register long long i = 1; i <= k; i++) {
    totcost += ob[i].cost;
  }
  return totcost <= s;
}
signed main() {
  amin[0] = 0x3f3f3f3f;
  bmin[0] = 0x3f3f3f3f;
  cin >> n >> m >> k >> s;
  for (register long long i = 1; i <= n; i++) {
    cin >> a[i];
    amin[i] = min(amin[i - 1], a[i]);
    if (amin[i - 1] > amin[i]) {
      aminid[i] = i;
    } else {
      aminid[i] = aminid[i - 1];
    }
  }
  for (register long long i = 1; i <= n; i++) {
    cin >> b[i];
    bmin[i] = min(bmin[i - 1], b[i]);
    if (bmin[i - 1] > bmin[i]) {
      bminid[i] = i;
    } else {
      bminid[i] = bminid[i - 1];
    }
  }
  for (register long long i = 1; i <= m; i++) {
    cin >> ob[i].t >> ob[i].c;
    ob[i].id = i;
  }
  low = 1, high = n;
  while (low <= high) {
    mid = (low + high) / 2;
    if (ok(mid)) {
      ans = mid;
      high = mid - 1;
    } else {
      low = mid + 1;
    }
  }
  if (!ans)
    cout << -1;
  else {
    cout << ans << endl;
    for (register long long i = 1; i <= m; i++) {
      if (ob[i].t == 1) {
        ob[i].cost = amin[ans] * ob[i].c;
      } else {
        ob[i].cost = bmin[ans] * ob[i].c;
      }
    }
    sort(ob + 1, ob + m + 1, cmp);
    for (register long long i = 1; i <= k; i++) {
      if (ob[i].t == 1)
        cout << ob[i].id << " " << aminid[ans] << endl;
      else
        cout << ob[i].id << " " << bminid[ans] << endl;
    }
  }
  return 0;
}
