#include <bits/stdc++.h>
using namespace std;
int n, m, k, te, re1, re2, d1[200005], d2[200005];
long long a[200005], b[200005], s;
vector<pair<long long, int> > v1, v2;
vector<long long> v3, v4;
int main() {
  cin >> n >> m >> k >> s;
  a[0] = 1e9;
  b[0] = 1e9;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] < a[i - 1])
      d1[i] = i;
    else {
      a[i] = a[i - 1];
      d1[i] = d1[i - 1];
    }
  }
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
    if (b[i] < b[i - 1])
      d2[i] = i;
    else {
      b[i] = b[i - 1];
      d2[i] = d2[i - 1];
    }
  }
  v1.clear();
  v2.clear();
  for (int i = 1; i <= m; i++) {
    cin >> te;
    if (te == 1) {
      cin >> te;
      v1.push_back(pair<long long, int>(te, i));
    } else {
      cin >> te;
      v2.push_back(pair<long long, int>(te, i));
    }
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  int i1 = 1, j1 = n, mid, re3 = 1e9;
  re1 = 1e9;
  re2 = 1e9;
  while (i1 < j1) {
    mid = (i1 + j1) / 2;
    v3.clear();
    v4.clear();
    for (int i = 0; i < v1.size(); i++) v3.push_back(v1[i].first * a[mid]);
    for (int i = 1; i < v1.size(); i++) v3[i] += v3[i - 1];
    for (int i = 0; i < v2.size(); i++) v4.push_back(v2[i].first * b[mid]);
    for (int i = 1; i < v2.size(); i++) v4[i] += v4[i - 1];
    bool fl = 1;
    for (int i = 0; i < v1.size(); i++) {
      if (v3[i] > s) break;
      int k1 = upper_bound(v4.begin(), v4.end(), s - v3[i]) - v4.begin();
      if (i + k1 + 1 >= k) {
        re1 = i;
        re2 = k - i - 2;
        re3 = mid;
        j1 = mid;
        fl = 0;
        break;
      }
    }
    if (v4.size() >= k && v4[k - 1] <= s) {
      re1 = -1;
      re2 = k - 1;
      j1 = mid;
      re3 = mid;
      fl = 0;
      continue;
    }
    if (fl) i1 = mid + 1;
  }
  if (i1 == j1) {
    mid = (i1 + j1) / 2;
    v3.clear();
    v4.clear();
    for (int i = 0; i < v1.size(); i++) v3.push_back(v1[i].first * a[mid]);
    for (int i = 1; i < v1.size(); i++) v3[i] += v3[i - 1];
    for (int i = 0; i < v2.size(); i++) v4.push_back(v2[i].first * b[mid]);
    for (int i = 1; i < v2.size(); i++) v4[i] += v4[i - 1];
    for (int i = 0; i < v1.size(); i++) {
      if (v3[i] > s) break;
      int k1 = upper_bound(v4.begin(), v4.end(), s - v3[i]) - v4.begin();
      if (i + k1 + 1 >= k) {
        re1 = i;
        re2 = k - i - 2;
        re3 = mid;
        j1 = mid;
        break;
      }
    }
    if (v4.size() >= k && v4[k - 1] <= s) {
      re1 = -1;
      re2 = k - 1;
      j1 = mid;
      re3 = mid;
    }
  }
  if (re3 != 1e9) {
    cout << re3 << endl;
    for (int i = 0; i <= re1; i++) {
      cout << v1[i].second << " " << d1[re3] << endl;
    }
    for (int i = 0; i <= re2; i++) {
      cout << v2[i].second << " " << d2[re3] << endl;
    }
  } else
    cout << -1 << endl;
  return 0;
}
