#include <bits/stdc++.h>
using namespace std;
long long int prod(long long int a, long long int b) {
  long long int x, d;
  if (b == 0)
    return 1;
  else {
    d = prod(a, b / 2);
    x = (d * d) % 1000000007;
    if (b % 2 == 0)
      return x;
    else
      return (x * (a % 1000000007)) % 1000000007;
  }
}
vector<pair<long long int, long long int> > vp, vd;
long long int k, s, d[1000005], p[1000005];
vector<pair<long long int, long long int> > vecans;
long long int foo(long long int day) {
  vecans.clear();
  vector<pair<long long int, pair<long long int, long long int> > > temp;
  long long int mind = 100000000000000009;
  long long int i;
  long long int dd, dp;
  for (i = 0; i < day; i++) {
    if (d[i] < mind) {
      mind = min(mind, d[i]);
      dd = i;
    }
  }
  long long int minp = 100000000000000009;
  for (i = 0; i < day; i++) {
    if (p[i] < minp) {
      minp = min(minp, p[i]);
      dp = i;
    }
  }
  if (!temp.empty()) temp.clear();
  for (i = 0; i < vd.size(); i++)
    temp.push_back(make_pair(mind * vd[i].first, make_pair(vd[i].second, dd)));
  for (i = 0; i < vp.size(); i++)
    temp.push_back(make_pair(minp * vp[i].first, make_pair(vp[i].second, dp)));
  sort(temp.begin(), temp.end());
  long long int cost = 0;
  for (i = 0; i < k; i++) {
    cost += temp[i].first;
    vecans.push_back(make_pair(temp[i].second.first, temp[i].second.second));
  }
  if (cost <= s)
    return 1;
  else
    return -1;
}
int main() {
  long long int n, m, i, l, r, t, c, mid;
  scanf("%lld", &n), scanf("%lld", &m), scanf("%lld", &k), scanf("%lld", &s);
  for (i = 0; i < n; i++) scanf("%lld", &d[i]);
  for (i = 0; i < n; i++) scanf("%lld", &p[i]);
  for (i = 0; i < m; i++) {
    scanf("%lld", &t), scanf("%lld", &c);
    if (t == 1)
      vd.push_back(make_pair(c, i));
    else
      vp.push_back(make_pair(c, i));
  }
  l = 1;
  r = n + 1;
  long long int ans = -1;
  vector<pair<long long int, long long int> > mainans;
  while (l < r) {
    mid = (l + r) / 2;
    long long int temp = foo(mid);
    if (temp == -1) {
      l = mid + 1;
    } else {
      ans = mid;
      mainans = vecans;
      r = mid;
    }
  }
  printf("%lld\n", ans);
  for (i = 0; i < mainans.size(); i++) {
    cout << mainans[i].first + 1 << " " << mainans[i].second + 1 << endl;
  }
  return 0;
}
