#include <bits/stdc++.h>
using namespace std;
pair<int, int> buyGadgets(int S, int dollarCost, int poundCost,
                          const vector<pair<int, int>> &dollarGadget,
                          const vector<pair<int, int>> &poundGadget,
                          const vector<long long> &dollarSum,
                          const vector<long long> &poundSum) {
  int dollarCursor = 0;
  int poundCursor = 0;
  while ((dollarCursor + 1 < dollarSum.size() &&
          dollarCost * dollarSum[dollarCursor + 1] +
                  poundCost * poundSum[poundCursor] <=
              S) ||
         (poundCursor + 1 < poundSum.size() &&
          dollarCost * dollarSum[dollarCursor] +
                  poundCost * poundSum[poundCursor + 1] <=
              S)) {
    if (poundCursor >= poundGadget.size() ||
        (dollarCursor < dollarGadget.size() &&
         dollarCost * dollarGadget[dollarCursor].first <
             poundCost * poundGadget[poundCursor].first)) {
      ++dollarCursor;
    } else {
      ++poundCursor;
    }
  }
  return make_pair(dollarCursor, poundCursor);
}
int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N, M, K, S;
  cin >> N >> M >> K >> S;
  vector<int> dollarCost;
  dollarCost.reserve(N);
  vector<int> poundCost;
  poundCost.reserve(N);
  for (int i = 0; i < N; ++i) {
    int a;
    cin >> a;
    dollarCost.push_back(a);
  }
  for (int i = 0; i < N; ++i) {
    int b;
    cin >> b;
    poundCost.push_back(b);
  }
  vector<pair<int, int>> dollarGadget;
  vector<pair<int, int>> poundGadget;
  for (int j = 0; j < M; ++j) {
    int t, c;
    cin >> t >> c;
    switch (t) {
      case 1:
        dollarGadget.emplace_back(c, j);
        break;
      case 2:
        poundGadget.emplace_back(c, j);
        break;
    }
  }
  sort(dollarGadget.begin(), dollarGadget.end());
  sort(poundGadget.begin(), poundGadget.end());
  vector<long long> dollarSum;
  dollarSum.reserve(dollarGadget.size() + 1);
  vector<long long> poundSum;
  poundSum.reserve(poundSum.size() + 1);
  dollarSum.push_back(0);
  poundSum.push_back(0);
  for (int i = 0; i < dollarGadget.size(); ++i)
    dollarSum.push_back(dollarSum.back() + dollarGadget[i].first);
  for (int i = 0; i < poundGadget.size(); ++i)
    poundSum.push_back(poundSum.back() + poundGadget[i].first);
  vector<pair<int, int>> bestDollarCost;
  bestDollarCost.reserve(N);
  vector<pair<int, int>> bestPoundCost;
  bestPoundCost.reserve(N);
  bestDollarCost.emplace_back(dollarCost.front(), 0);
  bestPoundCost.emplace_back(poundCost.front(), 0);
  for (int k = 1; k < N; ++k) {
    if (bestDollarCost.back().first > dollarCost[k]) {
      bestDollarCost.emplace_back(dollarCost[k], k);
    } else {
      bestDollarCost.push_back(bestDollarCost.back());
    }
    if (bestPoundCost.back().first > poundCost[k]) {
      bestPoundCost.emplace_back(poundCost[k], k);
    } else {
      bestPoundCost.push_back(bestPoundCost.back());
    }
  }
  int L = 0;
  int U = N;
  int currentDay = L + (U - L) / 2;
  while (L < U) {
    pair<int, int> gadgetCursors = buyGadgets(
        S, bestDollarCost[currentDay].first, bestPoundCost[currentDay].first,
        dollarGadget, poundGadget, dollarSum, poundSum);
    if (K <= gadgetCursors.first + gadgetCursors.second) {
      U = currentDay;
    } else {
      L = currentDay + 1;
    }
    currentDay = L + (U - L) / 2;
  }
  if (currentDay == N) {
    cout << -1 << endl;
  } else {
    pair<int, int> gadgetCursors = buyGadgets(
        S, bestDollarCost[currentDay].first, bestPoundCost[currentDay].first,
        dollarGadget, poundGadget, dollarSum, poundSum);
    vector<pair<int, int>> purchasedGadgets;
    purchasedGadgets.reserve(gadgetCursors.first + gadgetCursors.second);
    for (int i = 0; i < gadgetCursors.first; ++i) {
      purchasedGadgets.emplace_back(dollarGadget[i].second + 1,
                                    bestDollarCost[currentDay].second + 1);
    }
    for (int i = 0; i < gadgetCursors.second; ++i) {
      purchasedGadgets.emplace_back(poundGadget[i].second + 1,
                                    bestPoundCost[currentDay].second + 1);
    }
    sort(purchasedGadgets.begin(), purchasedGadgets.end());
    cout << currentDay + 1 << endl;
    for (int k = 0; k < K; ++k) {
      cout << purchasedGadgets[k].first << ' ' << purchasedGadgets[k].second
           << '\n';
    }
    cout << flush;
  }
  return 0;
}
