#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2 * 1000 * 100;
int a[MAXN], b[MAXN];
std::vector<pair<int, int> > aa, bb;
std::vector<pair<int, int> > res;
bool ok(int sz, int s, int k) {
  res.clear();
  int mnd = a[0], mnp = b[0];
  int bestd = 0, bestp = 0;
  for (int i = 0; i < sz; i++) {
    if (mnd > a[i]) bestd = i;
    mnd = min(mnd, a[i]);
  }
  for (int i = 0; i < sz; i++) {
    if (mnp > b[i]) bestp = i;
    mnp = min(mnp, b[i]);
  }
  int itaa = 0, itbb = 0;
  long long rem = s;
  for (int i = 0; i < k; i++) {
    if (itaa == (int)aa.size()) {
      rem -= bb[itbb].first * (long long)mnp;
      res.push_back(make_pair(bb[itbb].second, bestp));
      itbb++;
    } else if (itbb == (int)bb.size()) {
      rem -= aa[itaa].first * (long long)mnd;
      res.push_back(make_pair(aa[itaa].second, bestd));
      itaa++;
    } else {
      if (aa[itaa].first * (long long)mnd <= bb[itbb].first * (long long)mnp) {
        rem -= aa[itaa].first * (long long)mnd;
        res.push_back(make_pair(aa[itaa].second, bestd));
        itaa++;
      } else {
        rem -= bb[itbb].first * (long long)mnp;
        res.push_back(make_pair(bb[itbb].second, bestp));
        itbb++;
      }
    }
  }
  return rem >= 0LL;
}
int main() {
  int n, m, k, s;
  scanf("%d%d%d%d", &n, &m, &k, &s);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) scanf("%d", &b[i]);
  for (int i = 0; i < m; i++) {
    int t, in;
    scanf("%d%d", &t, &in);
    if (t == 1)
      aa.push_back(make_pair(in, i));
    else
      bb.push_back(make_pair(in, i));
  }
  sort(aa.begin(), aa.end());
  sort(bb.begin(), bb.end());
  int l = 1, r = n + 1;
  while (l <= r) {
    int md = (l + r) / 2;
    if (ok(md, s, k)) {
      r = md - 1;
    } else {
      l = md + 1;
    }
  }
  if (r + 1 > n) {
    puts("-1");
    return 0;
  }
  ok(r + 1, s, k);
  cout << r + 1 << endl;
  for (int i = 0; i < res.size(); i++) {
    cout << res[i].first + 1 << " " << res[i].second + 1 << endl;
  }
}
