#include <bits/stdc++.h>
using namespace std;
struct gadget {
  long long type, cost;
};
class TaskD {
  long long n, m, k, s;
  vector<long long> dollar, pound, max_dollar, max_pound;
  vector<gadget> g;
  bool check(long long v, bool out) {
    vector<pair<long long, long long>> tp(m);
    vector<long long> ratio(2);
    ratio[0] = dollar[max_dollar[v - 1]];
    ratio[1] = pound[max_pound[v - 1]];
    for (long long i = 0; i < m; i++) {
      tp[i] = {(g[i].cost * ratio[g[i].type - 1]), i};
    }
    nth_element(tp.begin(), tp.begin() + k - 1, tp.begin() + m);
    long long total_cost = 0;
    for (long long i = 0; i < k; i++) total_cost += (tp[i].first);
    if (out) {
      for (long long i = 0; i < k; i++) {
        long long idx = tp[i].second;
        long long day =
            (g[idx].type == 1 ? max_dollar[v - 1] : max_pound[v - 1]);
        idx++, day++;
        cout << idx << ' ' << day << '\n';
      }
    }
    return s >= total_cost;
  }
  long long binsearch() {
    long long lo = 0, hi = (n + 1);
    while (hi - lo > 1) {
      long long md = (lo + hi) / 2;
      if (check(md, false)) {
        hi = md;
      } else {
        lo = md;
      }
    }
    return hi;
  }

 public:
  TaskD(long long n, long long m, long long k, long long s) {
    this->n = n;
    this->m = m;
    this->k = k;
    this->s = s;
    dollar.resize(n);
    pound.resize(n);
    max_dollar.assign(n, 0);
    max_pound.assign(n, 0);
    g.resize(m);
  }
  void solve() {
    for (auto &x : dollar) cin >> x;
    for (auto &x : pound) cin >> x;
    for (long long i = 1; i < n; i++) {
      max_dollar[i] =
          (dollar[i] < dollar[max_dollar[i - 1]] ? i : max_dollar[i - 1]);
      max_pound[i] =
          (pound[i] < pound[max_pound[i - 1]] ? i : max_pound[i - 1]);
    }
    for (int i = 0; i < m; i++) {
      cin >> g[i].type >> g[i].cost;
    }
    long long res = binsearch();
    if (res > n) {
      cout << -1 << '\n';
    } else {
      cout << res << '\n';
      check(res, true);
    }
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, k, s;
  cin >> n >> m >> k >> s;
  TaskD D(n, m, k, s);
  D.solve();
}
