#include <bits/stdc++.h>
using namespace std;
vector<long long> za_dolary;
vector<long long> za_funty;
int czy_moze_kupic(long long dolar, long long funt, long long ile_mam, int k) {
  long long cena;
  for (int i = 0; i < k + 1; i++) {
    if (i < za_dolary.size() && k - i < za_funty.size()) {
      cena = 1LL * dolar * za_dolary[i] + 1LL * funt * za_funty[k - i];
      if (cena <= ile_mam) return i;
    }
  }
  return -1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  vector<pair<int, int> > za_dolary_numery;
  vector<pair<int, int> > za_funty_numery;
  int n, m, k, s;
  cin >> n >> m >> k >> s;
  int dolary[n];
  int funty[n];
  for (int i = 0; i < n; i++) cin >> dolary[i];
  for (int i = 0; i < n; i++) cin >> funty[i];
  za_dolary.push_back(0);
  za_funty.push_back(0);
  for (int i = 0; i < m; i++) {
    int ti, cena;
    cin >> ti >> cena;
    if (ti == 1) {
      za_dolary.push_back(cena);
      za_dolary_numery.push_back({cena, i + 1});
    } else {
      za_funty.push_back(cena);
      za_funty_numery.push_back({cena, i + 1});
    }
  }
  sort(za_dolary.begin(), za_dolary.end());
  sort(za_funty.begin(), za_funty.end());
  sort(za_dolary_numery.begin(), za_dolary_numery.end());
  sort(za_funty_numery.begin(), za_funty_numery.end());
  for (int i = 1; i < za_dolary.size(); i++) za_dolary[i] += za_dolary[i - 1];
  for (int i = 1; i < za_funty.size(); i++) za_funty[i] += za_funty[i - 1];
  int tanie_dolary[n][2];
  int tanie_funty[n][2];
  tanie_dolary[0][0] = dolary[0];
  tanie_dolary[0][1] = 0;
  tanie_funty[0][0] = funty[0];
  tanie_funty[0][1] = 0;
  for (int i = 1; i < n; i++) {
    if (dolary[i] < tanie_dolary[i - 1][0]) {
      tanie_dolary[i][0] = dolary[i];
      tanie_dolary[i][1] = i;
    } else {
      tanie_dolary[i][0] = tanie_dolary[i - 1][0];
      tanie_dolary[i][1] = tanie_dolary[i - 1][1];
    }
    if (funty[i] < tanie_funty[i - 1][0]) {
      tanie_funty[i][0] = funty[i];
      tanie_funty[i][1] = i;
    } else {
      tanie_funty[i][0] = tanie_funty[i - 1][0];
      tanie_funty[i][1] = tanie_funty[i - 1][1];
    }
  }
  int lt = 0;
  int rt = n;
  while (rt - lt > 1) {
    int sr = (lt + rt) / 2;
    int czy = czy_moze_kupic(tanie_dolary[sr][0], tanie_funty[sr][0], s, k);
    if (czy != -1) {
      rt = sr;
    } else
      lt = sr;
  }
  int ost = czy_moze_kupic(tanie_dolary[lt][0], tanie_funty[lt][0], s, k);
  if (ost == -1) {
    if (lt == n - 1) {
      cout << -1;
      return 0;
    }
    cout << rt + 1 << endl;
    ost = czy_moze_kupic(tanie_dolary[rt][0], tanie_funty[rt][0], s, k);
    for (int i = 0; i < ost; i++) {
      cout << za_dolary_numery[i].second << " " << tanie_dolary[rt][1] + 1
           << "\n";
    }
    for (int i = 0; i < k - ost; i++) {
      cout << za_funty_numery[i].second << " " << tanie_funty[rt][1] + 1
           << "\n";
    }
    return 0;
  }
  cout << lt + 1 << endl;
  for (int i = 0; i < ost; i++) {
    cout << za_dolary_numery[i].second << " " << tanie_dolary[lt][1] + 1
         << "\n";
  }
  for (int i = 0; i < k - ost; i++) {
    cout << za_funty_numery[i].second << " " << tanie_funty[lt][1] + 1 << "\n";
  }
  return 0;
}
