#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, m, k, s;
  cin >> n >> m >> k >> s;
  vector<long long> A(n), B(n);
  for (int i = 0; i < n; ++i) cin >> A[i];
  for (int i = 0; i < n; ++i) cin >> B[i];
  vector<pair<int, int>> G[2];
  vector<long long> T(m), C(m);
  for (int i = 0; i < m; ++i) {
    int t, c;
    cin >> t >> c;
    --t;
    T[i] = t;
    C[i] = c;
    G[t].emplace_back(c, i);
  }
  for (int i = 0; i < 2; ++i) sort(G[i].begin(), G[i].end());
  auto solve = [&](int d) {
    long long a = *min_element(A.begin(), A.begin() + d);
    int a_d = min_element(A.begin(), A.begin() + d) - A.begin();
    long long b = *min_element(B.begin(), B.begin() + d);
    int b_d = min_element(B.begin(), B.begin() + d) - B.begin();
    vector<pair<int, int>> Q;
    size_t idx[2] = {};
    for (int i = 0; i < k; ++i) {
      long long c = 1e18, k = -1;
      if (idx[0] < G[0].size()) c = a * G[0][idx[0]].first, k = 0;
      if (idx[1] < G[1].size() and c > b * G[1][idx[1]].first) k = 1;
      int dd = a_d;
      if (k) dd = b_d;
      Q.emplace_back(G[k][idx[k]].second, dd);
      ++idx[k];
    }
    return Q;
  };
  auto calc = [&](const vector<pair<int, int>>& Q) {
    long long ret = 0;
    for (auto p : Q) {
      if (T[p.first])
        ret += B[p.second] * C[p.first];
      else
        ret += A[p.second] * C[p.first];
      if (ret > s) return ret;
    }
    return ret;
  };
  int ok = n + 1, ng = 0;
  while (ok - ng > 1) {
    int mid = (ok + ng) / 2;
    auto Q = solve(mid);
    if (calc(Q) <= s)
      ok = mid;
    else
      ng = mid;
  }
  if (ok > n) {
    cout << -1 << endl;
    return 0;
  }
  cout << ok << "\n";
  auto Q = solve(ok);
  for (auto q : Q) cout << q.first + 1 << " " << q.second + 1 << "\n";
}
