#include <bits/stdc++.h>
using namespace std;
const int maxn = 200009;
int a[maxn], b[maxn], t[maxn], c[maxn];
vector<pair<long long, pair<int, int> > > items;
int n, m, s, k;
bool solve(int day) {
  items.clear();
  int mina = 0x3f3f3f3f, minb = 0x3f3f3f3f;
  int posa, posb;
  for (int i = 1; i <= day; i++) {
    if (a[i] < mina) {
      mina = a[i];
      posa = i;
    }
    if (b[i] < minb) {
      minb = b[i];
      posb = i;
    }
  }
  for (int i = 1; i <= m; i++) {
    if (t[i] == 1)
      items.push_back(make_pair(1ll * mina * c[i], make_pair(i, posa)));
    else
      items.push_back(make_pair(1ll * minb * c[i], make_pair(i, posb)));
  }
  long long sum = 0;
  sort(items.begin(), items.end());
  for (int i = 0; i < k; i++) sum += items[i].first;
  return s >= sum;
}
int main() {
  scanf("%d%d%d%d", &n, &m, &k, &s);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  for (int i = 1; i <= m; i++) scanf("%d%d", &t[i], &c[i]);
  int l = 0, r = n + 1;
  while (l + 1 < r) {
    int mid = (l + r) / 2;
    if (solve(mid))
      r = mid;
    else
      l = mid;
  }
  if (l == n) {
    printf("-1\n");
    return 0;
  }
  printf("%d\n", r);
  solve(r);
  for (int i = 0; i < k; i++) {
    printf("%d %d\n", items[i].second.first, items[i].second.second);
  }
  return 0;
}
