#include <bits/stdc++.h>
using namespace std;
const long long inf = 0x3f3f3f3f;
const long long N = 2e5 + 10;
long long a[N], b[N], k, s;
vector<pair<long long, long long> > ans, vec[2];
bool ck(long long tar) {
  long long Max1 = inf, Max2 = inf, f1 = -1, f2 = -1;
  for (long long i = 1; i <= tar; i++) {
    if (a[i] < Max1) {
      Max1 = a[i];
      f1 = i;
    }
    if (b[i] < Max2) {
      Max2 = b[i];
      f2 = i;
    }
  }
  long long res = 0;
  vector<pair<long long, long long> > r1;
  long long sum = 0;
  long long k1 = 0, k2 = 0, l = 0, r = 0;
  for (long long i = 0; i < (long long)vec[0].size(); i++) {
    pair<long long, long long> it = vec[0][i];
    if (sum + it.first * Max1 <= s) {
      sum += it.first * Max1, r1.push_back(it);
      if (i == (long long)vec[0].size() - 1) k1 = i + 1;
    } else {
      k1 = i;
      break;
    }
  }
  res = k1;
  l = k1;
  for (long long i = 0; i < (long long)vec[1].size(); i++) {
    pair<long long, long long> it = vec[1][i];
    if (sum + Max2 * it.first <= s) {
      sum += it.first * Max2;
      k2 = i + 1;
      if (k2 + k1 > res) {
        res = k2 + k1;
        l = k1;
        r = k2;
      }
    } else if (k1) {
      sum -= r1.back().first * Max1;
      r1.pop_back();
      k1--;
      i--;
    } else
      break;
  }
  if (l + r >= k) {
    ans.clear();
    long long cnt = 0;
    for (long long i = 0; cnt < k && i < l; cnt++, i++)
      ans.push_back({vec[0][i].second, f1});
    for (long long i = 0; cnt < k && i < r; cnt++, i++)
      ans.push_back({vec[1][i].second, f2});
    return 1;
  }
  return 0;
}
int32_t main() {
  std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n, m;
  cin >> n >> m >> k >> s;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i <= n; i++) cin >> b[i];
  for (long long i = 1, t, c; i <= m; i++) {
    cin >> t >> c;
    vec[--t].push_back({c, i});
  }
  sort(vec[0].begin(), vec[0].end());
  sort(vec[1].begin(), vec[1].end());
  long long l = 1, r = n, ANS = -1;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (ck(mid))
      r = mid - 1, ANS = mid;
    else
      l = mid + 1;
  }
  cout << ANS << '\n';
  if (ANS == -1) return 0;
  for (auto it : ans) cout << it.first << ' ' << it.second << '\n';
  return 0;
}
