#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, m, k, s;
int d[N], p[N];
struct node {
  int t, c;
} a[N], b[N];
int nd = 0, np = 0;
bool cmp(node a, node b) { return a.c < b.c; }
long long fun(int x) {
  long long sum = 0;
  int i, id, ip;
  for (i = id = ip = 1; i <= k; i++) {
    if ((id <= nd && ip > np) ||
        (id <= nd && ip <= np && a[id].c * d[x] < b[ip].c * p[x]))
      sum += (long long)a[id++].c * d[x];
    else
      sum += (long long)b[ip++].c * p[x];
  }
  return sum;
}
int main() {
  int cd, cp;
  scanf("%d%d%d%d", &n, &m, &k, &s);
  d[0] = p[0] = (1 << 30);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &d[i]);
    d[i] = min(d[i], d[i - 1]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
    p[i] = min(p[i], p[i - 1]);
  }
  int t;
  long long c;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &t, &c);
    if (t == 1) {
      a[++nd].c = c;
      a[nd].t = i;
    } else {
      b[++np].c = c;
      b[np].t = i;
    }
  }
  sort(a + 1, a + nd + 1, cmp);
  sort(b + 1, b + np + 1, cmp);
  if (fun(n) > (long long)s)
    printf("-1\n");
  else {
    int l = 1, r = n, mid;
    while (r > l) {
      mid = (r + l) >> 1;
      if (fun(mid) <= (long long)s)
        r = mid;
      else
        l = mid + 1;
    }
    printf("%d\n", l);
    int cd = 1, cp = 1, i, id, ip;
    while (d[cd] > d[l]) ++cd;
    while (p[cp] > p[l]) ++cp;
    for (i = id = ip = 1; i <= k; i++) {
      if ((id <= nd && ip > np) ||
          (id <= nd && ip <= np && a[id].c * d[l] < b[ip].c * p[l]))
        printf("%d %d\n", a[id++].t, cd);
      else
        printf("%d %d\n", b[ip++].t, cp);
    }
    return 0;
  }
}
