#include <bits/stdc++.h>
using namespace std;
const int maxn = 200002;
long long a[maxn];
long long b[maxn];
long long n, m, k, s;
vector<pair<long long, long long>> v, res;
bool sol(int d) {
  long long int cost_d = 1e9;
  long long int cost_p = 1e9;
  int d_day = -1;
  int p_day = -1;
  for (int i = 1; i < d + 1; i++) {
    if (a[i] < cost_d) {
      cost_d = a[i];
      d_day = i;
    }
    if (b[i] < cost_p) {
      cost_p = b[i];
      p_day = i;
    }
  }
  vector<pair<long long, pair<long long, long long>>> temp_ans;
  for (int i = 0; i < v.size(); i++) {
    if (v[i].first == 1) {
      temp_ans.push_back({v[i].second * cost_d, {i + 1, d_day}});
    } else {
      temp_ans.push_back({v[i].second * cost_p, {i + 1, p_day}});
    }
  }
  sort((temp_ans).begin(), (temp_ans).end());
  long long l = 0;
  vector<pair<long long, long long>> tem_res;
  for (int i = 0; i < k; i++) {
    l += temp_ans[i].first;
    if (l > s) return 0;
    tem_res.push_back({temp_ans[i].second.first, temp_ans[i].second.second});
  }
  res = tem_res;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    long long i, j, l, p, r;
    cin >> n >> m >> k >> s;
    for (i = 1; i <= n; i++) cin >> a[i];
    for (i = 1; i <= n; i++) cin >> b[i];
    for (i = 1; i <= m; i++) {
      cin >> p >> l;
      v.push_back({p, l});
    }
    l = 1;
    r = n;
    int ans = -1;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (sol(mid)) {
        r = mid - 1;
        ans = mid;
      } else
        l = mid + 1;
    }
    if (ans == -1)
      cout << -1;
    else {
      cout << ans << "\n";
      for (auto it : res) {
        cout << it.first << " " << it.second << "\n";
      }
    }
  }
}
