#include <bits/stdc++.h>
using namespace std;
void file() {}
int main() {
  file();
  long long n, m, need, purples;
  cin >> n >> m >> need >> purples;
  vector<long long> pounds(n), dollar(n), dIdx(n), pIdx(n);
  vector<pair<long long, int> > p, d;
  for (auto& e : dollar) cin >> e;
  for (auto& e : pounds) cin >> e;
  for (int i = 0; i < m; i++) {
    int a, c;
    cin >> a >> c;
    if (a == 1)
      d.push_back({c, i});
    else
      p.push_back({c, i});
  }
  dIdx[0] = pIdx[0] = 0;
  for (int i = 1; i < dollar.size(); i++) {
    if (dollar[i] < dollar[dIdx[i - 1]])
      dIdx[i] = i;
    else
      dIdx[i] = dIdx[i - 1];
  }
  for (int i = 1; i < pounds.size(); i++) {
    if (pounds[i] < pounds[pIdx[i - 1]])
      pIdx[i] = i;
    else
      pIdx[i] = pIdx[i - 1];
  }
  long long l = 0, r = n - 1, mid, dollarIdx, poundIdx;
  vector<pair<long long, pair<int, int> > > savedAns;
  int minDay = -1;
  while (l <= r) {
    mid = (l + r) / 2;
    long long it1 = 0, it2 = 0;
    dollarIdx = dIdx[mid];
    poundIdx = pIdx[mid];
    long long mnP = pounds[poundIdx], mnD = dollar[dollarIdx];
    vector<pair<long long, pair<int, int> > > ans;
    long long total = 0, cnt = 0;
    for (auto e : p) {
      ans.push_back({mnP * e.first, {e.second, poundIdx}});
    }
    for (auto e : d) {
      ans.push_back({mnD * e.first, {e.second, dollarIdx}});
    }
    sort(ans.begin(), ans.end());
    for (auto e : ans) {
      if (cnt == need)
        break;
      else {
        total += e.first;
        cnt++;
      }
    }
    if (total > purples) {
      l = mid + 1;
    } else {
      r = mid - 1;
      savedAns = ans;
      minDay = mid + 1;
    }
  }
  cout << minDay << endl;
  for (int i = 0; i < min(int(need), int(savedAns.size())); i++) {
    cout << savedAns[i].second.first + 1 << " " << savedAns[i].second.second + 1
         << endl;
  }
}
