#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
const long long inf = 999999999999999999ll;
vector<pair<int, int> > dollars;
vector<pair<int, int> > pounds;
int a[maxn], b[maxn], indmindol[maxn], indminpou[maxn];
long long cdollars[maxn], cpounds[maxn];
int k, s;
int check(int day) {
  int doll = a[day];
  int poun = b[day];
  long long minn = inf;
  int dmin;
  for (int d = 0; d <= k; d++) {
    if (d > dollars.size() || (k - d) > pounds.size()) continue;
    if (1ll * doll * cdollars[d] + poun * cpounds[k - d] < minn) {
      minn = 1ll * doll * cdollars[d] + poun * cpounds[k - d];
      dmin = d;
    }
  }
  if (minn <= s)
    return dmin;
  else
    return -1;
}
int main() {
  int n, m;
  scanf("%d%d%d%d", &n, &m, &k, &s);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  indmindol[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (a[i - 1] < a[i]) {
      a[i] = a[i - 1];
      indmindol[i] = indmindol[i - 1];
    } else
      indmindol[i] = i;
  }
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  indminpou[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (b[i - 1] < b[i]) {
      b[i] = b[i - 1];
      indminpou[i] = indminpou[i - 1];
    } else
      indminpou[i] = i;
  }
  for (int i = 1; i <= m; i++) {
    int type, cost;
    scanf("%d%d", &type, &cost);
    if (type == 1)
      dollars.push_back(make_pair(cost, i));
    else
      pounds.push_back(make_pair(cost, i));
  }
  sort(dollars.begin(), dollars.end());
  for (int i = 0; i < dollars.size(); i++)
    cdollars[i + 1] = cdollars[i] + dollars[i].first;
  sort(pounds.begin(), pounds.end());
  for (int i = 0; i < pounds.size(); i++)
    cpounds[i + 1] += cpounds[i] + pounds[i].first;
  if (check(n) == -1)
    puts("-1");
  else {
    int lo = 1;
    int hi = n;
    int ans;
    int doll;
    while (lo <= hi) {
      int res = check((lo + hi) / 2);
      if (res != -1) {
        ans = (lo + hi) / 2;
        doll = res;
        hi = (lo + hi) / 2 - 1;
      } else
        lo = (lo + hi) / 2 + 1;
    }
    printf("%d\n", ans);
    for (int i = 0; i < doll; i++)
      printf("%d %d\n", dollars[i].second, indmindol[ans]);
    for (int i = 0; i < k - doll; i++)
      printf("%d %d\n", pounds[i].second, indminpou[ans]);
  }
  return 0;
}
