#include <bits/stdc++.h>
using namespace std;
const int me = 200025;
int n, m, k, s;
int a[2][me], st[2][me << 2];
long long pref[2][me];
vector<pair<int, int> > gadgets[2];
int build(int w, int I, int low, int high) {
  if (low > high) return INT32_MAX;
  if (low == high) return st[w][I] = a[w][low];
  int mid = (low + high) >> 1;
  return st[w][I] = min(build(w, I << 1, low, mid),
                        build(w, (I << 1) | 1, mid + 1, high));
}
int get(int w, int I, int low, int high, int l, int r) {
  if (low > high || low > r || high < l) return INT32_MAX;
  if (low >= l && high <= r) return st[w][I];
  int mid = (low + high) >> 1;
  return min(get(w, I << 1, low, mid, l, r),
             get(w, (I << 1) | 1, mid + 1, high, l, r));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> k >> s;
  for (int i = 0; i < 2; i++)
    for (int j = 1; j <= n; j++) cin >> a[i][j];
  build(0, 1, 1, n);
  build(1, 1, 1, n);
  gadgets[0].push_back(make_pair(0, 0));
  gadgets[1].push_back(make_pair(0, 0));
  for (int i = 0; i < m; i++) {
    int t, c;
    cin >> t >> c;
    gadgets[t - 1].push_back(make_pair(c, i + 1));
  }
  sort(gadgets[0].begin(), gadgets[0].end());
  sort(gadgets[1].begin(), gadgets[1].end());
  for (int i = 0; i < 2; i++)
    for (int j = 1; j < gadgets[i].size(); j++)
      pref[i][j] = pref[i][j - 1] + gadgets[i][j].first;
  int low = 1, high = n, mid, best = n + 1;
  while (low <= high) {
    mid = (low + high + 1) >> 1;
    int good = 0;
    int min_dollar = get(0, 1, 1, n, 1, mid);
    int min_pound = get(1, 1, 1, n, 1, mid);
    for (int i = 0; i <= k && !good; i++) {
      if (i >= gadgets[0].size() || k - i >= gadgets[1].size()) continue;
      long long cost =
          1LL * min_dollar * pref[0][i] + 1LL * min_pound * pref[1][k - i];
      good |= cost <= s;
    }
    if (good) {
      best = mid;
      high = mid - 1;
    } else {
      low = mid + 1;
    }
  }
  if (best == n + 1) {
    cout << -1 << endl;
    return 0;
  }
  cout << best << endl;
  int min_dollar = get(0, 1, 1, n, 1, best);
  int min_pound = get(1, 1, 1, n, 1, best);
  int day[2];
  for (int i = 1; i <= best; i++)
    if (a[0][i] == min_dollar) day[0] = i;
  for (int i = 1; i <= best; i++)
    if (a[1][i] == min_pound) day[1] = i;
  for (int i = 0; i <= k; i++) {
    if (i >= gadgets[0].size() || k - i >= gadgets[1].size()) continue;
    long long cost =
        1LL * min_dollar * pref[0][i] + 1LL * min_pound * pref[1][k - i];
    if (cost <= s) {
      for (int j = 1; j <= i; j++)
        cout << gadgets[0][j].second << " " << day[0] << endl;
      for (int j = 1; j <= k - i; j++)
        cout << gadgets[1][j].second << " " << day[1] << endl;
      return 0;
    }
  }
  return 0;
}
