#include <bits/stdc++.h>
const int inf = 1e9 + 7;
using namespace std;
long long n, m, k, s, x, y, sum, w;
vector<pair<long long, pair<long long, long long>>> ans;
vector<pair<long long, long long>> dol, fund;
pair<long long, long long> a[200100], b[200100];
bool can(long long v) {
  ans.clear();
  sum = 0;
  long long mif = inf;
  long long mid = inf;
  long long in1 = -1;
  long long in2 = -1;
  for (long long i = 1; i <= v; i++) {
    if (mif > b[i].first) {
      mif = b[i].first;
      in2 = i;
    }
  }
  for (long long i = 1; i <= v; i++) {
    if (mid > a[i].first) {
      mid = a[i].first;
      in1 = i;
    }
  }
  for (long long i = 0; i < fund.size(); i++) {
    ans.push_back(
        make_pair(mif * fund[i].first, make_pair(fund[i].second, in2)));
  }
  for (long long i = 0; i < dol.size(); i++) {
    ans.push_back(make_pair(mid * dol[i].first, make_pair(dol[i].second, in1)));
  }
  sort(ans.begin(), ans.end());
  for (long long i = 0; i < k; i++) {
    sum += ans[i].first;
  }
  if (sum <= s)
    return 1;
  else
    return 0;
}
int vivod(int w) {
  ans.clear();
  sum = 0;
  long long mif = inf;
  long long mid = inf;
  long long in1 = -1;
  long long in2 = -1;
  for (long long i = 1; i <= w; i++) {
    if (mif > b[i].first) {
      mif = b[i].first;
      in2 = i;
    }
  }
  for (long long i = 1; i <= w; i++) {
    if (mid > a[i].first) {
      mid = a[i].first;
      in1 = i;
    }
  }
  for (long long i = 0; i < fund.size(); i++) {
    ans.push_back(
        make_pair(mif * fund[i].first, make_pair(fund[i].second, in2)));
  }
  for (long long i = 0; i < dol.size(); i++) {
    ans.push_back(make_pair(mid * dol[i].first, make_pair(dol[i].second, in1)));
  }
  sort(ans.begin(), ans.end());
  for (long long i = 0; i < k; i++) {
    sum += ans[i].first;
  }
  for (long long i = 0; i < k; i++) {
    cout << ans[i].second.first << " " << ans[i].second.second << endl;
  }
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k >> s;
  for (long long i = 1; i <= n; i++) {
    cin >> x;
    a[i] = (make_pair(x, i));
  }
  for (long long i = 1; i <= n; i++) {
    cin >> x;
    b[i] = (make_pair(x, i));
  }
  for (long long i = 1; i <= m; i++) {
    cin >> x >> y;
    if (x == 1)
      dol.push_back(make_pair(y, i));
    else
      fund.push_back(make_pair(y, i));
  }
  sort(dol.begin(), dol.end());
  sort(fund.begin(), fund.end());
  long long l = 0, r = n + 1, w = 0;
  while (l < r) {
    long long m = (l + r) / 2;
    if (can(m)) {
      w = m;
      r = m;
    } else
      l = m + 1;
  }
  if (w >= 1 && w <= n) {
    cout << w << endl;
  } else {
    cout << -1;
    return 0;
  }
  vivod(w);
}
