#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int INF = 1061109567;
const long long LINF = 4557430888798830399ll;
const int MOD = 998244353;
int n, m, k, s;
int a[200005];
int b[200005];
struct Node {
  int id;
  int t;
  int c;
  long long s;
  Node() {}
  Node(int id, int t, int c, long long s) : id(id), t(t), c(c), s(s) {}
  bool operator<(const Node& nd) const { return s < nd.s; }
} nd[200005];
bool check(int day) {
  int mina = a[day];
  int minb = b[day];
  for (int i = 1; i <= m; ++i) {
    if (nd[i].t == 1)
      nd[i].s = 1ll * nd[i].c * mina;
    else
      nd[i].s = 1ll * nd[i].c * minb;
  }
  nth_element(nd + 1, nd + k, nd + 1 + m);
  long long sum = 0;
  for (int i = 1; i <= k; ++i) {
    sum += nd[i].s;
    if (sum > s) return false;
  }
  return true;
}
int bs() {
  int L = 1, R = n;
  while (1) {
    int M = (L + R) >> 1;
    if (L == M) {
      if (check(L)) return L;
      if (R != L && check(R)) return R;
      return -1;
    }
    if (check(M))
      R = M;
    else
      L = M + 1;
  }
}
void test_case() {
  scanf("%d%d%d%d", &n, &m, &k, &s);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 2; i <= n; ++i) a[i] = min(a[i], a[i - 1]);
  for (int i = 1; i <= n; ++i) scanf("%d", &b[i]);
  for (int i = 2; i <= n; ++i) b[i] = min(b[i], b[i - 1]);
  for (int i = 1; i <= m; ++i) {
    int t, c;
    scanf("%d%d", &t, &c);
    nd[i] = Node(i, t, c, 0);
  }
  int res = bs();
  if (res == -1) {
    printf("-1\n");
    return;
  }
  printf("%d\n", res);
  int daya = 0, dayb = 0;
  for (int i = 1; i <= k; ++i) {
    int day = 0;
    if (nd[i].t == 1) {
      if (daya == 0) {
        int cost = nd[i].s / nd[i].c;
        for (int i = 1; i <= n; ++i) {
          if (a[i] == cost) {
            daya = i;
            break;
          }
        }
      }
      day = daya;
    } else {
      if (dayb == 0) {
        int cost = nd[i].s / nd[i].c;
        for (int i = 1; i <= n; ++i) {
          if (b[i] == cost) {
            dayb = i;
            break;
          }
        }
      }
      day = dayb;
    }
    printf("%d %d\n", nd[i].id, day);
  }
}
int main() {
  int t = 1;
  for (int i = 1; i <= t; ++i) {
    test_case();
  }
  return 0;
}
