#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using ll = long long;
const int INF = numeric_limits<int>::max();
const int MINF = numeric_limits<int>::min();
const int N = 2e5;
int na, nb;
int a[N], b[N];
pii ga[N], gb[N];
ll ta[N + 1], tb[N + 1];
void analyze(int pa, int pb, int& cnt_a, int& cnt_b) {
  cnt_a = lower_bound(ga, ga + na, pii{pa + 1, MINF}) - ga;
  cnt_b = lower_bound(gb, gb + nb, pii{pb + 1, MINF}) - gb;
}
int main() {
  int n, m, k, s;
  assert(scanf("%d %d %d %d", &n, &m, &k, &s) == 4);
  for (int i = 0; i < n; ++i) {
    assert(scanf("%d", a + i) == 1);
  }
  for (int i = 0; i < n; ++i) {
    assert(scanf("%d", b + i) == 1);
  }
  for (int i = 1; i <= m; ++i) {
    int t, s;
    assert(scanf("%d %d", &t, &s) == 2);
    if (t == 1) {
      ga[na++] = pii{s, i};
    } else {
      gb[nb++] = pii{s, i};
    }
  }
  sort(ga, ga + na);
  sort(gb, gb + nb);
  ta[0] = tb[0] = 0;
  for (int i = 0; i < na; ++i) {
    ta[i + 1] = ta[i] + ga[i].first;
  }
  for (int i = 0; i < nb; ++i) {
    tb[i + 1] = tb[i] + gb[i].first;
  }
  int min_a = INF, min_b = INF, pos_a = -1, pos_b = -1;
  for (int i = 1; i <= n; ++i) {
    bool updated = false;
    if (a[i - 1] < min_a) {
      pos_a = i;
      min_a = a[i - 1];
      updated = true;
    }
    if (b[i - 1] < min_b) {
      pos_b = i;
      min_b = b[i - 1];
      updated = true;
    }
    if (!updated) {
      continue;
    }
    int left = 0;
    int right = s + 1;
    while (left + 1 < right) {
      int mid = (left + right) / 2;
      int cnt_a = 0;
      int cnt_b = 0;
      analyze(mid / min_a, mid / min_b, cnt_a, cnt_b);
      if (cnt_a + cnt_b >= k) {
        right = mid;
      } else {
        left = mid;
      }
    }
    int cnt_a = 0, cnt_b = 0;
    analyze(left / min_a, left / min_b, cnt_a, cnt_b);
    ll tot = ta[cnt_a] * min_a + tb[cnt_b] * min_b;
    int missing = k - (cnt_a + cnt_b);
    tot += 1LL * missing * right;
    if (tot <= s) {
      analyze(right / min_a, right / min_b, cnt_a, cnt_b);
      printf("%d\n", i);
      int cnt_k = 0;
      for (int j = 0; cnt_k < k && j < cnt_a; ++j) {
        printf("%d %d\n", ga[j].second, pos_a);
        ++cnt_k;
      }
      for (int j = 0; cnt_k < k && j < cnt_b; ++j) {
        printf("%d %d\n", gb[j].second, pos_b);
        ++cnt_k;
      }
      return 0;
    }
  }
  printf("-1\n");
  return 0;
}
