#include <bits/stdc++.h>
using namespace std;
long long db[200005], pb[200005], t[200005], p[200005];
bool vis[200005];
vector<pair<long long, int> > v;
bool func(int n, int m, int k, int s) {
  for (int i = 0; i < m; i++) vis[i] = 0;
  long long md = INT_MAX, mp = INT_MAX, id, ip;
  for (int i = 1; i <= n; i++)
    if (db[i] < md) md = db[i], id = i;
  for (int i = 1; i <= n; i++)
    if (pb[i] < mp) mp = pb[i], ip = i;
  vector<pair<long long, int> > vec;
  for (int i = 0; i < m; i++) {
    if (t[i] == 1)
      vec.push_back({md * p[i], i});
    else
      vec.push_back({mp * p[i], i});
  }
  sort(vec.begin(), vec.end());
  v.clear();
  int cnt = 0;
  for (int i = 0; i < k; i++)
    if (!vis[vec[i].second]) {
      vis[vec[i].second] = 1;
      if (vec[i].first > s)
        break;
      else {
        int day;
        int ind = vec[i].second;
        if (t[ind] == 1)
          day = id;
        else
          day = ip;
        v.push_back({ind + 1, day});
        cnt++, s -= vec[i].first;
      }
    }
  return (cnt == k);
}
int main() {
  int n, m, k, s;
  scanf("%d %d %d %d", &n, &m, &k, &s);
  for (int i = 1; i <= n; i++) scanf("%lld", &db[i]);
  for (int i = 1; i <= n; i++) scanf("%lld", &pb[i]);
  for (int i = 0; i < m; i++) scanf("%lld %lld", &t[i], &p[i]);
  int lo = 1, hi = n, res = -1;
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    if (func(mid, m, k, s))
      res = mid, hi = mid - 1;
    else
      lo = mid + 1;
  }
  if (res != -1) func(res, m, k, s);
  printf("%d\n", res);
  if (res != -1) {
    for (int i = 0; i < v.size(); i++)
      printf("%lld %d\n", v[i].first, v[i].second);
  }
  return 0;
}
