#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > item[2];
vector<pair<long long, long long> > ans;
long long a[1000000], b[1000000];
long long sum[2][300010];
long long n, m, k, s;
bool check(long long limit) {
  ans.clear();
  long long d1 = 0, d2 = 0;
  for (int i = 1; i <= limit; ++i) {
    if (d1 == 0 || a[d1] > a[i]) d1 = i;
    if (d2 == 0 || b[d2] > b[i]) d2 = i;
  }
  for (int i = 0; i <= k; ++i) {
    int j = k - i;
    if (i > item[0].size() || j > item[1].size()) continue;
    long long rem = sum[0][i] * a[d1] + sum[1][j] * b[d2];
    if (rem <= s) {
      for (int l = 0; l < i; ++l) {
        ans.push_back(make_pair(item[0][l].second, d1));
      }
      for (int l = 0; l < j; ++l) {
        ans.push_back(make_pair(item[1][l].second, d2));
      }
      return true;
    }
  }
  return false;
}
int main() {
  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];
  }
  item[0].clear();
  item[1].clear();
  long long x, y;
  for (int i = 1; i <= m; ++i) {
    cin >> x >> y;
    item[x - 1].push_back(make_pair(y, i));
  }
  for (int i = 0; i < 2; ++i) {
    sort(item[i].begin(), item[i].end());
  }
  for (int i = 0; i < 2; ++i) {
    sum[i][0] = 0;
    for (int j = 0; j < item[i].size(); ++j) {
      sum[i][j + 1] = sum[i][j] + item[i][j].first;
    }
  }
  if (!check(n)) {
    cout << -1;
    return 0;
  }
  long long l = 1, r = n;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (check(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  check(r + 1);
  cout << r + 1 << "\n";
  for (int i = 0; i < ans.size(); ++i) {
    cout << ans[i].first << " " << ans[i].second << "\n";
  }
}
