#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200000 + 5;
int c1[MAXN], c2[MAXN];
int cost1[MAXN], cost2[MAXN];
int re1[MAXN], re2[MAXN];
int use[MAXN], reflag[MAXN];
int cnt1, cnt2;
long long sum1[MAXN], sum2[MAXN];
int vis[MAXN];
int n, m, k, s;
struct D {
  int u, v;
} d1[MAXN], d2[MAXN];
bool cmp(D a, D b) { return a.v < b.v; }
int solve(int u, int &mark) {
  long long ans = s + 1;
  int t1, t2;
  t1 = min(cnt1, k), t2 = k - t1;
  mark = 0;
  while (t2 <= k && t2 <= cnt2 && t1 >= 0) {
    long long temp = sum1[t1] * cost1[u] + sum2[t2] * cost2[u];
    if (ans > temp) ans = temp, mark = t2;
    t2++, t1--;
  }
  if (ans > s) return s + 1;
  int temp = ans;
  return temp;
}
int main() {
  while (scanf("%d%d%d%d", &n, &m, &k, &s) != EOF) {
    cost1[0] = cost2[0] = (1000000007);
    for (int i = 1; i <= n; i++) {
      scanf("%d", &c1[i]);
      if (cost1[i - 1] < c1[i])
        cost1[i] = cost1[i - 1], re1[i] = re1[i - 1];
      else
        cost1[i] = c1[i], re1[i] = i;
    }
    for (int i = 1; i <= n; i++) {
      scanf("%d", &c2[i]);
      if (cost2[i - 1] < c2[i])
        cost2[i] = cost2[i - 1], re2[i] = re2[i - 1];
      else
        cost2[i] = c2[i], re2[i] = i;
    }
    cnt1 = cnt2 = 0;
    int u, v;
    for (int i = 1; i <= m; i++) {
      scanf("%d%d", &u, &v);
      if (u == 1)
        d1[++cnt1].u = i, d1[cnt1].v = v;
      else
        d2[++cnt2].u = i, d2[cnt2].v = v;
      reflag[i] = u;
    }
    sort(d1 + 1, d1 + cnt1 + 1, cmp);
    sort(d2 + 1, d2 + cnt2 + 1, cmp);
    sum1[0] = sum2[0] = 0;
    for (int i = 1; i <= cnt1; i++) sum1[i] = sum1[i - 1] + d1[i].v;
    for (int i = 1; i <= cnt2; i++) sum2[i] = sum2[i - 1] + d2[i].v;
    int ans;
    int le = 1, re = n;
    while (le < re - 1) {
      int mid = (le + re) >> 1;
      if (solve(mid, ans) <= s)
        re = mid;
      else
        le = mid;
    }
    int mark;
    ans = -1;
    if (solve(le, mark) <= s)
      ans = le;
    else if (solve(re, mark) <= s)
      ans = re;
    if (ans == -1) {
      printf("%d\n", ans);
      continue;
    } else {
      for (int i = 1; i <= m; i++) vis[i] = 0;
      for (int i = 1; i <= k - mark; i++) vis[d1[i].u] = 1;
      for (int j = 1; j <= mark; j++) vis[d2[j].u] = 1;
      printf("%d\n", ans);
      for (int i = 1; i <= m; i++) {
        if (vis[i]) {
          if (reflag[i] == 1)
            printf("%d %d\n", i, re1[ans]);
          else
            printf("%d %d\n", i, re2[ans]);
        }
      }
    }
  }
  return 0;
}
