#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
template <typename T>
inline void read(T &x) {
  char c;
  bool nega = 0;
  while ((!isdigit(c = getchar())) && (c != '-'))
    ;
  if (c == '-') {
    nega = 1;
    c = getchar();
  }
  x = c - 48;
  while (isdigit(c = getchar())) x = x * 10 + c - 48;
  if (nega) x = -x;
}
template <typename T>
inline void writep(T x) {
  if (x > 9) writep(x / 10);
  putchar(x % 10 + 48);
}
template <typename T>
inline void write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  writep(x);
}
template <typename T>
inline void writeln(T x) {
  write(x);
  putchar('\n');
}
int n, m, k;
ll s;
ll a[200001];
ll b[200001];
deque<pair<ll, int> > d, p;
vector<pair<int, int> > trace;
bool check(int u) {
  int bd = 1, bp = 1;
  for (int i = (2); i <= (u); i++) {
    if (a[bd] > a[i]) bd = i;
    if (b[bp] > b[i]) bp = i;
  }
  vector<int> buyd;
  vector<int> buyp;
  deque<pair<ll, int> > td = d;
  deque<pair<ll, int> > tp = p;
  ll remain = s;
  while (true) {
    if (td.empty()) {
      if (tp.empty()) break;
      if (tp.front().first * b[bp] <= remain) {
        remain -= tp.front().first * b[bp];
        buyp.push_back(tp.front().second);
        tp.pop_front();
      } else
        break;
    } else {
      if (tp.empty()) {
        if (td.front().first * a[bd] <= remain) {
          remain -= td.front().first * a[bd];
          buyd.push_back(td.front().second);
          td.pop_front();
        } else
          break;
      } else {
        if (td.front().first * a[bd] < tp.front().first * b[bp]) {
          if (td.front().first * a[bd] <= remain) {
            remain -= td.front().first * a[bd];
            buyd.push_back(td.front().second);
            td.pop_front();
          } else
            break;
        } else {
          if (tp.front().first * b[bp] <= remain) {
            remain -= tp.front().first * b[bp];
            buyp.push_back(tp.front().second);
            tp.pop_front();
          } else
            break;
        }
      }
    }
    if (buyd.size() + buyp.size() == k) break;
  }
  if (buyd.size() + buyp.size() == k) {
    trace.clear();
    for (int x : buyd) trace.push_back(make_pair(x, bd));
    for (int x : buyp) trace.push_back(make_pair(x, bp));
  } else
    return 0;
}
int main() {
  read(n);
  read(m);
  read(k);
  read(s);
  for (int i = (1); i <= (n); i++) read(a[i]);
  for (int i = (1); i <= (n); i++) read(b[i]);
  {
    int t, c;
    for (int i = (1); i <= (m); i++) {
      read(t);
      read(c);
      if (t == 1)
        d.push_back(make_pair(c, i));
      else
        p.push_back(make_pair(c, i));
    }
  }
  sort(d.begin(), d.end());
  sort(p.begin(), p.end());
  int low = 1, high = n, mid, ans = n + 1;
  while (low <= high) {
    mid = (low + high) / 2;
    if (check(mid)) {
      ans = mid;
      high = mid - 1;
    } else
      low = mid + 1;
  }
  if (ans == n + 1) {
    puts("-1");
    return 0;
  }
  writeln(ans);
  for (pair<int, int> p : trace) {
    write(p.first);
    putchar(' ');
    writeln(p.second);
  }
}
