#include <bits/stdc++.h>
using namespace std;
long long bp(long long a, long long b, long long mod = 1e9 + 7) {
  a %= mod;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b /= 2;
  }
  return res;
}
const long long INF = 1e16;
const long long mod = 1e9 + 7;
long long n, m, k, s;
vector<long long> dollar, pound;
vector<pair<long long, int>> min_dollar, min_pound;
vector<pair<long long, int>> item_dollar, item_pound;
vector<long long> pref_dollar, pref_pound;
int no_dollar, no_pound;
bool good(int m) {
  if ((int)item_dollar.size() + (int)item_pound.size() < k) return false;
  for (int i = min(k, (long long)item_dollar.size()); i >= 0; i--) {
    long long rem = k - i;
    if (rem > (long long)item_pound.size()) continue;
    assert(i <= (int)item_dollar.size() && rem <= (int)item_pound.size());
    long long req_bd = pref_dollar[i] * min_dollar[m].first;
    long long req_bp = pref_pound[rem] * min_pound[m].first;
    if (req_bd + req_bp <= s) {
      no_dollar = i, no_pound = rem;
      return true;
    }
  }
  return false;
}
void solve() {
  cin >> n >> m >> k >> s;
  dollar.assign(n, 0), pound.assign(n, 0);
  min_dollar = vector<pair<long long, int>>(n);
  min_pound = vector<pair<long long, int>>(n);
  for (auto &it : dollar) cin >> it;
  for (auto &it : pound) cin >> it;
  pair<long long, int> nim_d = {1e9, 0}, nim_p = {1e9, 0};
  for (int i = 0; i < n; i++) {
    if (dollar[i] < nim_d.first) nim_d = {dollar[i], i};
    if (pound[i] < nim_p.first) nim_p = {pound[i], i};
    min_dollar[i] = nim_d, min_pound[i] = nim_p;
  }
  for (int i = 0; i < m; i++) {
    long long type, cost;
    cin >> type >> cost;
    if (type == 1)
      item_dollar.push_back({cost, i + 1});
    else
      item_pound.push_back({cost, i + 1});
  }
  pref_dollar = vector<long long>((int)item_dollar.size() + 1);
  pref_pound = vector<long long>((int)item_pound.size() + 1);
  sort(item_dollar.begin(), item_dollar.end());
  sort(item_pound.begin(), item_pound.end());
  for (int i = 1; i <= (int)item_dollar.size(); i++) {
    pref_dollar[i] = pref_dollar[i - 1] + item_dollar[i - 1].first;
  }
  for (int i = 1; i <= (int)item_pound.size(); i++) {
    pref_pound[i] = pref_pound[i - 1] + item_pound[i - 1].first;
  }
  int l = -1, r = n;
  while (l + 1 < r) {
    int m = (l + r) / 2;
    if (good(m))
      r = m;
    else
      l = m;
  }
  if (r == n)
    cout << -1;
  else {
    cout << r + 1 << "\n";
    for (int i = 0; i < no_dollar; i++)
      cout << item_dollar[i].second << " " << min_dollar[r].second + 1 << "\n";
    for (int i = 0; i < no_pound; i++)
      cout << item_pound[i].second << " " << min_pound[r].second + 1 << "\n";
  }
}
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  long long ttt = 1;
  for (long long rep = 1; rep <= ttt; rep++) {
    solve();
  }
}
