#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
template <typename T>
using v = vector<T>;
const long long inf = 4611686018427387903;
void read() {}
template <typename Arg, typename... Args>
void read(Arg& arg, Args&... args) {
  cin >> (arg);
  read(args...);
}
void print() {}
template <typename Arg, typename... Args>
void print(Arg arg, Args... args) {
  cout << (arg) << " ";
  print(args...);
}
void debug() { cout << endl; }
template <typename Arg, typename... Args>
void debug(Arg arg, Args... args) {
  cout << (arg) << " ";
  debug(args...);
}
long long getInt() {
  long long a;
  cin >> a;
  return a;
}
void run() {
  long long n, m, k, s;
  read(n, m, k, s);
  long long a[n];
  for (long long i = (0); i < (n); i++) cin >> a[i];
  long long b[n];
  for (long long i = (0); i < (n); i++) cin >> b[i];
  v<pair<long long, long long>> dollar, pound;
  for (long long i = (0); i < (m); i++) {
    long long t, c;
    read(t, c);
    if (t == 1)
      dollar.push_back({c, i});
    else
      pound.push_back({c, i});
  }
  sort(dollar.begin(), dollar.end());
  sort(pound.begin(), pound.end());
  long long l = 0, r = n + 1;
  while (l + 1 < r) {
    long long p = (l + r) / 2;
    long long dayDollar = 0, dayPound = 0;
    for (long long i = (1); i < (p); i++) {
      if (a[dayDollar] > a[i]) dayDollar = i;
      if (b[dayPound] > b[i]) dayPound = i;
    }
    vector<long long> z[m];
    long long pz = 0;
    for (auto i : dollar) z[pz++] = {i.first * a[dayDollar], i.second, 1};
    for (auto i : pound) z[pz++] = {i.first * b[dayPound], i.second, 2};
    sort(z, z + m);
    long long tot = 0;
    for (long long i = (0); i < (k); i++) tot += z[i][0];
    if (tot <= s)
      r = p;
    else
      l = p;
  }
  if (r == n + 1)
    cout << -1;
  else {
    long long p = r;
    cout << p;
    cout << endl;
    long long dayDollar = 0, dayPound = 0;
    for (long long i = (1); i < (p); i++) {
      if (a[dayDollar] > a[i]) dayDollar = i;
      if (b[dayPound] > b[i]) dayPound = i;
    }
    vector<long long> z[m];
    long long pz = 0;
    for (auto i : dollar)
      z[pz++] = {i.first * a[dayDollar], i.second, dayDollar};
    for (auto i : pound) z[pz++] = {i.first * b[dayPound], i.second, dayPound};
    sort(z, z + m);
    for (long long i = (0); i < (k); i++) {
      print(z[i][1] + 1, z[i][2] + 1);
    }
  }
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  run();
  return 0;
}
