#include <bits/stdc++.h>
using namespace std;
class gad {
 public:
  gad(int t1, int c1, int n) {
    t = t1;
    c = c1;
    num = n;
  }
  int t;
  int c;
  int num;
};
bool men(gad a1, gad a2) {
  if (a1.c < a2.c) return true;
  return false;
}
int main() {
  int64_t n, m, k, s;
  cin >> n >> m >> k >> s;
  vector<gad> t1;
  t1.reserve(200005);
  vector<gad> t2;
  t1.reserve(200005);
  vector<int> d1;
  d1.reserve(200005);
  vector<int> d2;
  d2.reserve(200005);
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    d1.push_back(a);
  }
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    d2.push_back(a);
  }
  for (int i = 0; i < m; ++i) {
    int t, c;
    cin >> t >> c;
    gad g(t, c, i + 1);
    if (t == 1)
      t1.push_back(g);
    else
      t2.push_back(g);
  }
  sort(t1.begin(), t1.end(), men);
  sort(t2.begin(), t2.end(), men);
  int64_t kyp1 = 0;
  int64_t kyp2 = 0;
  int64_t st1 = 0;
  int64_t st2 = 0;
  int64_t min1 = 10000000;
  int64_t min2 = 10000000;
  int64_t den1 = 0;
  int64_t den2 = 0;
  for (int i = 0; i < n; ++i) {
    if (min1 < 10000000 && d1[i] < min1) s += st1 * (min1 - d1[i]);
    if (min2 < 10000000 && d2[i] < min2) s += st2 * (min2 - d2[i]);
    if (min1 > d1[i]) {
      min1 = d1[i];
      den1 = i + 1;
    }
    if (min2 > d2[i]) {
      min2 = d2[i];
      den2 = i + 1;
    }
    for (;;) {
      if (k == 0) {
        cout << i + 1;
        for (int i1 = 0; i1 < kyp1; ++i1)
          cout << endl << t1[i1].num << ' ' << den1;
        for (int i2 = 0; i2 < kyp2; ++i2)
          cout << endl << t2[i2].num << ' ' << den2;
        return 0;
      }
      if (t1.size() > kyp1) {
        if (t1[kyp1].c * min1 <= s / k) {
          s -= t1[kyp1].c * min1;
          st1 += t1[kyp1].c;
          --k;
          ++kyp1;
        } else if (t2.size() > kyp2) {
          if (t2[kyp2].c * min2 <= s / k) {
            s -= t2[kyp2].c * min2;
            st2 += t2[kyp2].c;
            --k;
            ++kyp2;
          } else
            break;
        } else
          break;
      } else if (t2.size() > kyp2) {
        if (t2[kyp2].c * min2 <= s / k) {
          s -= t2[kyp2].c * min2;
          st2 += t2[kyp2].c;
          --k;
          ++kyp2;
        } else
          break;
      } else
        break;
    }
  }
  cout << -1;
  return 0;
}
