#include <bits/stdc++.h>
using namespace std;
template <typename T>
T nextInt() {
  T x = 0, p = 1;
  char ch;
  do {
    ch = getchar();
  } while (ch <= ' ');
  if (ch == '-') {
    p = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * p;
}
const int maxN = (int)2e5 + 10;
const int INF = (int)1e9;
const int mod = (int)1e9 + 7;
const long long LLINF = (long long)1e18;
long long mincostA[maxN];
int mindayA[maxN];
int mindayB[maxN];
long long mincostB[maxN];
long long fA[maxN];
long long fB[maxN];
int n, m, k, s;
vector<pair<int, int> > a, b;
bool can(int day) {
  int dollarCost = mincostA[day];
  int poundCost = mincostB[day];
  for (int i = 0; i <= k; ++i) {
    if (i > a.size() || k - i > b.size()) continue;
    long long needInDollars = (i == 0 ? 0 : fA[i - 1]);
    long long needInPounds = (k - i == 0 ? 0 : fB[k - i - 1]);
    if (needInDollars * 1LL * dollarCost + needInPounds * poundCost <= s) {
      return true;
    }
  }
  return false;
}
void answer(int day) {
  int dollarCost = mincostA[day];
  int poundCost = mincostB[day];
  for (int i = 0; i <= k; ++i) {
    if (i > a.size() || k - i > b.size()) continue;
    long long needInDollars = (i == 0 ? 0 : fA[i - 1]);
    long long needInPounds = (k - i == 0 ? 0 : fB[k - i - 1]);
    if (needInDollars * 1LL * dollarCost + needInPounds * poundCost <= s) {
      ;
    } else
      continue;
    cout << day << '\n';
    for (int j = 0; j < i; ++j) {
      cout << a[j].second << ' ' << mindayA[day] << '\n';
    }
    for (int j = 0; j < k - i; ++j) {
      cout << b[j].second << ' ' << mindayB[day] << '\n';
    }
    exit(0);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> k >> s;
  for (int i = 1; i <= n; ++i) {
    cin >> mincostA[i];
    mindayA[i] = i;
    if (i >= 2 && mincostA[i - 1] < mincostA[i]) {
      mincostA[i] = mincostA[i - 1];
      mindayA[i] = mindayA[i - 1];
    }
  }
  for (int i = 1; i <= n; ++i) {
    cin >> mincostB[i];
    mindayB[i] = i;
    if (i >= 2 && mincostB[i - 1] < mincostB[i]) {
      mincostB[i] = mincostB[i - 1];
      mindayB[i] = mindayB[i - 1];
    }
  }
  for (int i = 0; i < m; ++i) {
    int t, c;
    cin >> t >> c;
    if (t == 1)
      a.push_back({c, i + 1});
    else
      b.push_back({c, i + 1});
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  fill(fA, fA + maxN, LLINF);
  fill(fB, fB + maxN, LLINF);
  for (int i = 0; i < a.size(); ++i) {
    fA[i] = a[i].first;
    if (i >= 1) fA[i] += fA[i - 1];
  }
  for (int i = 0; i < b.size(); ++i) {
    fB[i] = b[i].first;
    if (i >= 1) fB[i] += fB[i - 1];
  }
  if (!can(n)) return cout << -1, 0;
  int l = 1, r = n;
  for (int it = 0; it < 20; ++it) {
    int mid = (l + r) / 2;
    if (can(mid))
      r = mid;
    else
      l = mid;
  }
  for (int i = max(1, l - 3);; ++i) {
    if (can(i)) answer(i);
  }
  return 0;
}
