#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - 48;
    ch = getchar();
  }
  return x * f;
}
int n, m, k, num1 = 0, num2 = 0, totald, s;
int a[300000], b[300000], ans1[300000], ans2[300000];
long long sum1[300000], sum2[300000];
struct Node {
  int v, id;
} d[300000], p[300000];
bool cmp(Node a, Node b) { return a.v < b.v; }
void write(int x, int d1, int d2) {
  ans1[0] = d1;
  ans2[0] = d2;
  for (int i = 1; i <= x; i++) ans1[i] = d[i].id;
  for (int i = 1; i <= k - x; i++) ans2[i] = p[i].id;
}
bool check(int x) {
  int mind = 1000000007, minp = 1000000007, day1, day2;
  long long ans;
  for (int i = 1; i <= x; i++) {
    if (mind > a[i]) mind = a[i], day1 = i;
    if (minp > b[i]) minp = b[i], day2 = i;
  }
  for (int i = 0; i <= k; i++) {
    if (i > num1) break;
    if (k - i > num2) continue;
    ans = (long long)sum1[i] * mind + (long long)sum2[k - i] * minp;
    if (ans <= s) {
      write(i, day1, day2);
      totald = i;
      return true;
    }
  }
  return false;
}
int main() {
  scanf("%d%d%d%d", &n, &m, &k, &s);
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 1; i <= n; i++) b[i] = read();
  int x, y;
  for (int i = 1; i <= m; i++) {
    x = read();
    y = read();
    if (x == 1) d[++num1].v = y, d[num1].id = i;
    if (x == 2) p[++num2].v = y, p[num2].id = i;
  }
  sort(d + 1, d + num1 + 1, cmp);
  sort(p + 1, p + num2 + 1, cmp);
  for (int i = 1; i <= num1; i++) sum1[i] = sum1[i - 1] + d[i].v;
  for (int i = 1; i <= num2; i++) sum2[i] = sum2[i - 1] + p[i].v;
  if (!check(n)) {
    printf("-1");
    return 0;
  }
  int l = 0, r = n, mid;
  while (l < r) {
    mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", r);
  for (int i = 1; i <= totald; i++) printf("%d %d\n", ans1[i], ans1[0]);
  for (int i = 1; i <= k - totald; i++) printf("%d %d\n", ans2[i], ans2[0]);
  return 0;
}
