#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long n, m, k, s;
vector<pair<long long, long long>> x, y;
long long d[200005], p[200005], t[200005], c[200005];
bool can(int day) {
  long long idxd, idxp, mind = 1e9, minp = 1e9;
  for (int i = (1); i <= (day); i++)
    mind = min(mind, d[i]), minp = min(minp, p[i]);
  long long val = 0;
  long long idx = 0, l = 0, r = 0;
  while (idx < k) {
    long long costl = x[l].first * mind;
    long long costr = y[r].first * minp;
    if (costl <= costr && l < int(x.size()))
      val += costl, l++;
    else
      val += costr, r++;
    idx++;
  }
  if (val <= s) return true;
  return false;
}
void go(int day) {
  cout << day << endl;
  long long idxd, idxp, mind = 1e9, minp = 1e9;
  for (int i = (1); i <= (day); i++) {
    if (d[i] < mind) {
      mind = d[i];
      idxd = i;
    }
    if (p[i] < minp) {
      minp = p[i];
      idxp = i;
    }
  }
  long long val = 0;
  long long idx = 0, l = 0, r = 0;
  while (idx < k) {
    long long costl = x[l].first * mind;
    long long costr = y[r].first * minp;
    if (costl <= costr && l < int(x.size()))
      cout << x[l].second << " " << idxd << endl, l++;
    else
      cout << y[r].second << " " << idxp << endl, r++;
    idx++;
  }
}
int main() {
  cin >> n >> m >> k >> s;
  for (int i = (1); i <= (n); i++) cin >> d[i];
  for (int i = (1); i <= (n); i++) cin >> p[i];
  for (int i = (1); i <= (m); i++) cin >> t[i] >> c[i];
  for (int i = (1); i <= (m); i++)
    if (t[i] == 1)
      x.push_back(make_pair(c[i], i));
    else
      y.push_back(make_pair(c[i], i));
  x.push_back(make_pair(1e15, 1e8));
  y.push_back(make_pair(1e15, 1e8));
  sort(x.begin(), x.end());
  sort(y.begin(), y.end());
  if (!can(n)) {
    cout << "-1\n";
    return 0;
  }
  long long lo = 1, hi = n, mid;
  while (lo < hi) {
    mid = (lo + hi) / 2;
    if (can(mid))
      hi = mid;
    else
      lo = mid + 1;
  }
  go(hi);
  return 0;
}
