#include <bits/stdc++.h>
using namespace std;
long long int n, m, k, s;
pair<long long int, long long int> pref1[200001], pref2[200001];
vector<pair<long long int, long long int>> one, two;
bool ok(long long int x, bool p) {
  long long int c1 = pref1[x].first;
  long long int d1 = pref1[x].second;
  long long int c2 = pref2[x].first;
  long long int d2 = pref2[x].second;
  long long int tot = s;
  queue<pair<long long int, long long int>> o, t;
  for (long long int j = 0; j < (long long int)one.size(); j++) {
    o.push(one[j]);
  }
  for (long long int j = 0; j < (long long int)two.size(); j++) {
    t.push(two[j]);
  }
  long long int cnt = 0;
  while ((!o.empty()) && (!t.empty())) {
    if (o.front().first * c1 <= t.front().first * c2) {
      if (p) cout << o.front().second << " " << d1 << "\n";
      tot -= o.front().first * c1;
      o.pop();
    } else {
      if (p) cout << t.front().second << " " << d2 << "\n";
      tot -= t.front().first * c2;
      t.pop();
    }
    if (tot < 0) return false;
    cnt++;
    if (cnt >= k) return true;
  }
  while (!o.empty()) {
    if (p) cout << o.front().second << " " << d1 << "\n";
    tot -= o.front().first * c1;
    o.pop();
    cnt++;
    if (tot < 0) return false;
    if (cnt >= k) return true;
  }
  while (!t.empty()) {
    if (p) cout << t.front().second << " " << d2 << "\n";
    tot -= t.front().first * c2;
    t.pop();
    cnt++;
    if (tot < 0) return false;
    if (cnt >= k) return true;
  }
  return false;
}
void solve() {
  cin >> n >> m >> k >> s;
  cin >> pref1[1].first;
  pref1[1].second = 1;
  for (long long int j = 2; j <= n; j++) {
    long long int c;
    cin >> c;
    if (c < pref1[j - 1].first) {
      pref1[j].first = c;
      pref1[j].second = j;
    } else {
      pref1[j] = pref1[j - 1];
    }
  }
  cin >> pref2[1].first;
  pref2[1].second = 1;
  for (long long int j = 2; j <= n; j++) {
    long long int c;
    cin >> c;
    if (c < pref2[j - 1].first) {
      pref2[j].first = c;
      pref2[j].second = j;
    } else {
      pref2[j] = pref2[j - 1];
    }
  }
  for (long long int j = 1; j <= m; j++) {
    long long int t, c;
    cin >> t >> c;
    if (t == 1) {
      one.push_back({c, j});
    } else {
      two.push_back({c, j});
    }
  }
  sort(one.begin(), one.end());
  sort(two.begin(), two.end());
  long long int l = 1, r = n;
  while (r - l + 1 > 2) {
    long long int x = (l + r) / 2;
    if (ok(x, 0)) {
      r = x;
    } else {
      l = x;
    }
  }
  if (r - l + 1 == 2) {
    if (ok(l, 0)) {
      cout << l << "\n";
      ok(l, 1);
      return;
    } else if (ok(r, 0)) {
      cout << r << "\n";
      ok(r, 1);
      return;
    } else {
      cout << -1 << "\n";
      return;
    }
  }
  if (ok(l, 0)) {
    cout << l << "\n";
    ok(l, 1);
    return;
  }
  cout << -1 << "\n";
  return;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
