#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long alphabet = 256;
multiset<pair<long long, long long> > dollar, pound;
long long a[200005], b[200005], t[200005], c[200005];
long long predollar[200005], prepound[200005], precostdollar[200005],
    precostpound[200005];
long long gadjetD[1000005], gadjetP[1000005];
void printarray(long long arr[], long long n) {
  for (int i = 1; i <= n; i++) cout << arr[i] << " ";
  cout << endl;
}
int main() {
  long long n, m, k, s;
  cin >> n >> m >> k >> s;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i <= n; i++) cin >> b[i];
  for (long long i = 1; i <= m; i++) {
    cin >> t[i] >> c[i];
    if (t[i] == 1) {
      dollar.insert({c[i], i});
    } else
      pound.insert({c[i], i});
  }
  predollar[0] = 1e18, prepound[0] = 1e18;
  for (long long i = 1; i <= n; i++) {
    predollar[i] = min(predollar[i - 1], a[i]);
    prepound[i] = min(prepound[i - 1], b[i]);
  }
  long long sz = 1;
  for (auto e : dollar) {
    precostdollar[sz] = precostdollar[sz - 1] + e.first;
    sz++;
  }
  sz = 1;
  for (auto e : pound) {
    precostpound[sz] = precostpound[sz - 1] + e.first;
    sz++;
  }
  long long l = 1, r = n, ans = 1e15, coff = 0;
  while (l <= r) {
    long long mid = (l + r) / 2;
    long long sz1 = dollar.size(), sz2 = pound.size();
    long long tot = 1e18;
    long long temp1;
    for (long long i = 0; i <= sz1; i++) {
      if (sz2 < k - i) continue;
      long long value = precostdollar[i] * predollar[mid] +
                        precostpound[k - i] * prepound[mid];
      if (tot > value) {
        tot = value;
        temp1 = i;
      }
    }
    if (tot <= s) {
      if (ans > mid) {
        ans = mid;
        coff = temp1;
      }
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  sz = 1;
  for (auto e : dollar) {
    if (sz > coff) break;
    gadjetD[e.second] = 1;
    sz++;
  }
  sz = 1;
  for (auto e : pound) {
    if (sz > k - coff) break;
    gadjetP[e.second] = 1;
    sz++;
  }
  if (ans == 1e15) {
    cout << -1;
    return 0;
  }
  cout << ans << endl;
  long long f1 = 0, f2 = 0;
  for (long long i = 1; i <= n; i++) {
    if (a[i] == predollar[ans] && !f1) {
      for (int j = 1; j <= m; j++) {
        if (gadjetD[j] == 1) cout << j << " " << i << endl;
      }
      f1 = 1;
    }
    if (b[i] == prepound[ans] && !f2) {
      for (int j = 1; j <= m; j++) {
        if (gadjetP[j] == 1) cout << j << " " << i << endl;
      }
      f2 = 1;
    }
  }
}
