#include <bits/stdc++.h>
using namespace std;
int N, M, K, bestday[2][200200];
long long S, c[2][200200], V;
int lo, hi, mid, best = 2e9;
vector<pair<int, long long> > v;
struct gadget {
  long long cost;
  int ind;
  bool type;
  bool operator<(const gadget &o) const {
    return cost * c[type][mid] < o.cost * c[o.type][mid];
  }
} g[200200];
bool check() {
  sort(g, g + M);
  V = 0;
  int got = 0;
  v.clear();
  for (int i = 0; i < M; i++) {
    V += g[i].cost * c[g[i].type][mid];
    if (V > S) break;
    v.push_back({g[i].ind, bestday[g[i].type][mid]});
    got++;
  }
  return got >= K;
}
int main() {
  cin >> N >> M >> K >> S;
  for (int d = 0; d < 2; d++)
    for (int i = 0; i < N; i++) {
      cin >> c[d][i];
      bestday[d][i] = i + 1;
      if (i) {
        if (c[d][i] > c[d][i - 1]) bestday[d][i] = bestday[d][i - 1];
        c[d][i] = min(c[d][i], c[d][i - 1]);
      }
    }
  for (int i = 0; i < M; i++) {
    int temp;
    cin >> temp >> g[i].cost;
    g[i].type = temp == 2;
    g[i].ind = i + 1;
  }
  lo = 0, hi = N - 1;
  while (lo <= hi) {
    mid = (lo + hi) / 2;
    if (check()) {
      best = min(best, mid);
      hi = mid - 1;
    } else {
      lo = mid + 1;
    }
  }
  if (best == 2e9) {
    puts("-1");
    return 0;
  }
  cout << best + 1 << endl;
  mid = best;
  check();
  for (auto i : v) {
    if (K) cout << i.first << ' ' << i.second << endl, K--;
  }
  return 0;
}
