#include <bits/stdc++.h>
using namespace std;
const long long maxN = 1e9 + 5;
vector<int> a;
vector<int> b;
vector<pair<int, int> > aa;
vector<pair<int, int> > bb;
long long n, m, k, s;
long long s1St, s2St;
long long indexStartA, indexStartB;
long long sum1[200010], sum2[200010];
struct Res {
  int dayA, dayB, indexEndA, indexEndB;
};
Res res;
void build() {
  sort((aa).begin(), (aa).end());
  sort((bb).begin(), (bb).end());
  int n = aa.size();
  for (int i = 0; i < n; i++) {
    if (i == 0)
      sum1[0] = aa[i].first;
    else
      sum1[i] = sum1[i - 1] + aa[i].first;
  }
  n = bb.size();
  for (int i = 0; i < n; i++) {
    if (i == 0)
      sum2[0] = bb[i].first;
    else
      sum2[i] = sum2[i - 1] + bb[i].first;
  }
}
bool F(int d) {
  pair<long long, long long> aMin, bMin;
  aMin.first = bMin.first = maxN;
  for (int i = 0; i <= d; ++i) {
    if (a[i] < aMin.first) {
      aMin = make_pair(a[i], i);
    }
    if (b[i] < bMin.first) {
      bMin = make_pair(b[i], i);
    }
  }
  for (int i = 0; i <= k && i <= aa.size(); i++) {
    int num1 = i, num2 = k - i;
    if (num1 <= aa.size() && num2 <= bb.size()) {
      long long temp = 0;
      if (num1 > 0) temp += sum1[num1 - 1] * aMin.first;
      if (num2 > 0) temp += sum2[num2 - 1] * bMin.first;
      if (temp <= s) {
        res.indexEndA = i;
        res.indexEndB = k - i;
        res.dayA = aMin.second + 1;
        res.dayB = bMin.second + 1;
        return true;
      }
    }
  }
  return false;
}
int main() {
  cin >> n >> m >> k >> s;
  a.resize(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  b.resize(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &b[i]);
  }
  for (int i = 0; i < m; ++i) {
    int z, x;
    scanf("%d%d", &z, &x);
    (z == 1 ? aa : bb).push_back(make_pair(x, i + 1));
  }
  build();
  int l = 0, r = n;
  while (r - l > 1) {
    int d = (l + r) / 2;
    if (F(d)) {
      r = d;
    } else {
      l = d;
    }
  }
  for (int i = l; i <= r; ++i) {
    if (i != n && F(i)) {
      cout << i + 1 << endl;
      for (int i = 0; i < res.indexEndA; ++i) {
        printf("%d %d\n", aa[i].second, res.dayA);
      }
      for (int i = 0; i < res.indexEndB; ++i) {
        printf("%d %d\n", bb[i].second, res.dayB);
      }
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
