#include <bits/stdc++.h>
using namespace std;
long long const N = 2e5 + 10, OO = 1e18, mod = 1e9 + 7;
long long n, m, k, s, c, t, ans1, ans2;
long long money[2][N], premoney[2][N], preid[2][N], prebudget[2][N], mn[2];
vector<pair<int, int> > budget[2];
bool check(int id) {
  mn[0] = premoney[0][id];
  mn[1] = premoney[1][id];
  for (int i = 0; i <= k; i++) {
    if (i <= budget[0].size() && k - i <= budget[1].size()) {
      ans2 = prebudget[0][i] * mn[0];
      ans1 = prebudget[1][k - i] * mn[1];
      if (ans1 + ans2 <= s) return true;
    }
  }
  return false;
}
vector<pair<int, int> > build(int id) {
  mn[0] = premoney[0][id];
  mn[1] = premoney[1][id];
  vector<pair<int, int> > ans;
  for (int i = 0; i <= k; i++) {
    if (i <= budget[0].size() && k - i <= budget[1].size()) {
      ans2 = prebudget[0][i] * mn[0];
      ans1 = prebudget[1][k - i] * mn[1];
      if (ans1 + ans2 <= s) {
        for (int i1 = 0; i1 <= i - 1; i1++) {
          ans.push_back(make_pair(budget[0][i1].second, preid[0][id]));
        }
        for (int i1 = 0; i1 <= k - i - 1; i1++) {
          ans.push_back(make_pair(budget[1][i1].second, preid[1][id]));
        }
        return ans;
      }
    }
  }
}
int main() {
  cin >> n >> m >> k >> s;
  for (int j = 0; j < 2; j++)
    for (int i = 1; i <= n; i++) cin >> money[j][i];
  premoney[0][0] = premoney[1][0] = 1e9;
  for (int j = 0; j < 2; j++)
    for (int i = 1; i <= n; i++) {
      premoney[j][i] =
          ((premoney[j][i - 1] > money[j][i]) ? money[j][i]
                                              : premoney[j][i - 1]);
      preid[j][i] = ((premoney[j][i - 1] > money[j][i]) ? i : preid[j][i - 1]);
    }
  for (int i = 1; i <= m; i++) {
    cin >> t >> c;
    budget[t - 1].push_back(make_pair(c, i));
  }
  sort(budget[0].begin(), budget[0].end());
  sort(budget[1].begin(), budget[1].end());
  for (int j = 0; j < 2; j++) {
    for (int i = 0; i < budget[j].size(); i++) {
      prebudget[j][i + 1] =
          ((!i) ? budget[j][i].first : budget[j][i].first + prebudget[j][i]);
    }
  }
  int s = 1, e = n, ans = -1;
  while (s <= e) {
    int mid = (s + e) / 2;
    if (check(mid))
      ans = mid, e = mid - 1;
    else
      s = mid + 1;
  }
  cout << ans;
  if (ans != -1) {
    vector<pair<int, int> > p = build(ans);
    for (int i = 0; i < p.size(); i++)
      cout << endl << p[i].first << " " << p[i].second;
  }
}
