#include <bits/stdc++.h>
using namespace std;
int oo = 1e9 + 7;
int n, m, k, s;
int dol[1000008];
int boun[1000008];
int minn1[1000008], minn2[1000008];
vector<pair<long long, int> > lef, rig;
int main() {
  scanf("%d%d", &n, &m);
  scanf("%d%d", &k, &s);
  for (int i = 1; i <= n; i++) scanf("%d", &dol[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &boun[i]);
  for (int i = 1; i <= m; i++) {
    int typ;
    int cost;
    scanf("%d%d", &typ, &cost);
    if (typ == 1)
      lef.push_back(pair<long long, int>(cost, i));
    else
      rig.push_back(pair<long long, int>(cost, i));
  }
  minn1[1] = dol[1];
  minn2[1] = boun[1];
  sort(lef.begin(), lef.end());
  sort(rig.begin(), rig.end());
  for (int i = 1; i < (int)lef.size(); i++) lef[i].first += lef[i - 1].first;
  for (int i = 1; i < (int)rig.size(); i++) rig[i].first += rig[i - 1].first;
  for (int i = 2; i <= n; i++) minn1[i] = min(dol[i], minn1[i - 1]);
  for (int i = 2; i <= n; i++) minn2[i] = min(boun[i], minn2[i - 1]);
  int ans = oo;
  int fuck = -1, lol = -1;
  for (int i = 0; i <= (int)lef.size() && i <= k; i++)
    for (int j = k - i; j <= (int)rig.size() && j + i == k; j++) {
      int minn = 0, maxx = n + 1, midd;
      while (minn + 1 < maxx) {
        midd = (maxx + minn) >> 1;
        int cur = minn1[midd];
        long long rem =
            (long long)s -
            (long long)(i == 0 ? 0 : lef[i - 1].first) * (long long)cur;
        cur = minn2[midd];
        rem -= (long long)(j == 0 ? 0 : rig[j - 1].first) * (long long)cur;
        if (rem >= 0)
          maxx = midd;
        else
          minn = midd;
      }
      if (maxx < n + 1)
        if (maxx < ans) {
          ans = maxx;
          fuck = i;
          lol = j;
        }
    }
  if (fuck == -1) {
    printf("-1");
    return 0;
  }
  printf("%d\n", ans);
  int day;
  int cur = oo;
  for (int i = 1; i <= ans; i++)
    if (dol[i] < cur) {
      cur = dol[i];
      day = i;
    }
  for (int i = 0; i < fuck; i++) printf("%d %d\n", lef[i].second, day);
  cur = oo;
  for (int i = 1; i <= ans; i++)
    if (boun[i] < cur) {
      cur = boun[i];
      day = i;
    }
  for (int i = 0; i < lol; i++) printf("%d %d\n", rig[i].second, day);
}
