#include <bits/stdc++.h>
using namespace std;
const long long maxn = 200000 + 10;
long long n, m, k, s;
long long a[maxn], b[maxn];
long long Ma[maxn], Mb[maxn];
long long ida[maxn], idb[maxn];
long long t[maxn], c[maxn];
long long cost[maxn];
long long divide(long long a, long long b) {
  long long ans = a / b;
  if (a % b != 0) ans++;
  return ans;
}
long long r[maxn];
bool cmp(long long i, long long j) { return cost[i] < cost[j]; }
bool check(long long x) {
  for (long long i = 1; i <= m; i++) {
    if (t[i] == 1)
      cost[i] = Ma[x] * c[i];
    else
      cost[i] = Mb[x] * c[i];
  }
  for (long long i = 1; i <= m; i++) r[i] = i;
  sort(r + 1, r + 1 + m, cmp);
  long long sum = 0;
  for (long long i = 1; i <= k; i++) {
    sum += cost[r[i]];
    if (sum > s) return false;
  }
  return true;
}
int main() {
  scanf("%lld%lld%lld%lld", &n, &m, &k, &s);
  for (long long i = 1; i <= n; i++) scanf("%lld", a + i);
  for (long long i = 1; i <= n; i++) scanf("%lld", b + i);
  for (long long i = 1; i <= m; i++) scanf("%lld%lld", t + i, c + i);
  Ma[1] = a[1];
  Mb[1] = b[1];
  ida[1] = idb[1] = 1;
  for (long long i = 2; i <= n; i++) {
    Ma[i] = min(Ma[i - 1], a[i]);
    Mb[i] = min(Mb[i - 1], b[i]);
    if (a[i] < Ma[i - 1])
      ida[i] = i;
    else
      ida[i] = ida[i - 1];
    if (b[i] < Mb[i - 1])
      idb[i] = i;
    else
      idb[i] = idb[i - 1];
  }
  long long L = 1, R = n;
  check(1);
  if (!check(R)) {
    printf("-1\n");
    return 0;
  }
  while (L < R) {
    long long mid = (L + R) / 2;
    if (check(mid))
      R = mid;
    else
      L = mid + 1;
  }
  check(L);
  printf("%lld\n", L);
  for (long long i = 1; i <= k; i++) {
    long long haha;
    if (t[r[i]] == 1)
      haha = ida[L];
    else
      haha = idb[L];
    printf("%lld %lld\n", r[i], haha);
  }
  return 0;
}
