#include <bits/stdc++.h>
using namespace std;
pair<long long int, int> rated[200000 + 100];
pair<long long int, int> ratep[200000 + 100];
vector<pair<long long int, int> > acost;
vector<pair<long long int, int> > bcost;
pair<long long int, int> ans[200000 + 100];
long long int n, m, k;
int anscnt = 0;
bool ok(int x, long long int s, int ansflag) {
  long long int rd = rated[x].first;
  long long int rp = ratep[x].first;
  int pa = 0, pb = 0;
  int cnt = 0;
  anscnt = 0;
  int flag = 1;
  while (cnt < k && flag) {
    if (pa < acost.size() && pb < bcost.size()) {
      if (acost[pa].first * rd < bcost[pb].first * rp) {
        if (s - acost[pa].first * rd < 0)
          flag = 0;
        else {
          s -= acost[pa].first * rd;
          if (ansflag)
            ans[anscnt++] = make_pair(acost[pa].second, rated[x].second);
          cnt++;
          pa++;
        }
      } else {
        if (s - bcost[pb].first * rp < 0)
          flag = 0;
        else {
          s -= bcost[pb].first * rp;
          if (ansflag)
            ans[anscnt++] = make_pair(bcost[pb].second, ratep[x].second);
          cnt++;
          pb++;
        }
      }
    } else if (pa < acost.size() && pb >= bcost.size()) {
      if (s - acost[pa].first * rd < 0)
        flag = 0;
      else {
        s -= acost[pa].first * rd;
        if (ansflag)
          ans[anscnt++] = make_pair(acost[pa].second, rated[x].second);
        cnt++;
        pa++;
      }
    } else if (pa >= acost.size() && pb < bcost.size()) {
      if (s - bcost[pb].first * rp < 0)
        flag = 0;
      else {
        s -= bcost[pb].first * rp;
        if (ansflag)
          ans[anscnt++] = make_pair(bcost[pb].second, ratep[x].second);
        cnt++;
        pb++;
      }
    } else
      flag = 0;
  }
  if (cnt >= k)
    return true;
  else
    return false;
}
int main() {
  long long int s;
  cin >> n >> m >> k >> s;
  long long int mini = 0x3f3f3f3f, minpos = 1;
  memset(rated, 0, sizeof(rated));
  memset(ratep, 0, sizeof(ratep));
  memset(ans, 0, sizeof(ans));
  for (int i = 1; i <= n; i++) {
    long long int t;
    cin >> t;
    if (t < mini) {
      mini = t;
      minpos = i;
    }
    rated[i] = make_pair(mini, minpos);
  }
  mini = 0x3f3f3f3f, minpos = 1;
  for (int i = 1; i <= n; i++) {
    long long int t;
    cin >> t;
    if (t < mini) {
      mini = t;
      minpos = i;
    }
    ratep[i] = make_pair(mini, minpos);
  }
  for (int i = 1; i <= m; i++) {
    long long int t, c;
    cin >> t >> c;
    if (t == 1)
      acost.push_back(make_pair(c, i));
    else
      bcost.push_back(make_pair(c, i));
  }
  sort(acost.begin(), acost.end());
  sort(bcost.begin(), bcost.end());
  int lo = 1, hi = n;
  while (lo < hi) {
    int mid = (lo + hi) >> 1;
    if (ok(mid, s, 0))
      hi = mid;
    else
      lo = mid + 1;
  }
  if (ok(lo, s, 1)) {
    cout << lo << endl;
    for (int i = 0; i < anscnt; i++) {
      cout << ans[i].first << " " << ans[i].second << endl;
    }
  } else
    cout << "-1" << endl;
  return 0;
}
