#include <bits/stdc++.h>
using namespace std;
int N, M, K, S;
long long A[200005], B[200005];
pair<int, long long> C[200005];
vector<pair<long long, pair<int, int> > > V;
bool chk(int n) {
  long long c1, c2;
  int d1, d2;
  c1 = c2 = (1LL << 60);
  for (int i = 1; i <= n; i++) {
    if (A[i] < c1) {
      d1 = i;
      c1 = A[i];
    }
    if (B[i] < c2) {
      d2 = i;
      c2 = B[i];
    }
  }
  V.clear();
  for (int i = 1; i <= M; i++) {
    if (C[i].first == 1) {
      V.push_back(make_pair(C[i].second * c1, make_pair(i, d1)));
    } else {
      V.push_back(make_pair(C[i].second * c2, make_pair(i, d2)));
    }
  }
  sort(V.begin(), V.end());
  long long tot = 0;
  for (int i = 0; i <= K - 1; i++) tot += V[i].first;
  return tot <= S;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> M >> K >> S;
  for (int i = 1; i <= N; i++) cin >> A[i];
  for (int i = 1; i <= N; i++) cin >> B[i];
  for (int i = 1; i <= M; i++) cin >> C[i].first >> C[i].second;
  int l = 0, r = N + 1;
  while ((l + 1) < r) {
    int m = (l + r) / 2;
    if (chk(m))
      r = m;
    else
      l = m;
  }
  if (l == N) {
    cout << -1 << '\n';
    return 0;
  }
  chk(r);
  cout << r << '\n';
  for (int i = 0; i <= K - 1; i++)
    cout << V[i].second.first << ' ' << V[i].second.second << '\n';
  return 0;
}
