#include <bits/stdc++.h>
using namespace std;
long long vd[200005], vp[200005], d[200005], p[200005], dm = 0, pm = 0, m, n, k,
                                                        s;
int dd[1000005] = {0}, pp[1000005] = {0};
pair<int, int> a[200005];
bool check(int day) {
  long long t, i = 1, j, sum, x, y;
  long long mind = 100000000;
  long long minp = 100000000;
  for (i = 1; i <= day; i++) {
    if (d[i] < mind) mind = d[i];
    if (p[i] < minp) minp = p[i];
  }
  t = k, i = 0, j = 0, sum = s;
  while (t-- && sum > 0) {
    if (i < dm && j < pm) {
      x = mind * vd[i];
      y = minp * vp[j];
      if (x <= y) {
        sum -= x;
        i++;
      } else {
        sum -= y;
        j++;
      }
    } else if (i < dm) {
      x = mind * vd[i];
      sum -= x;
      i++;
    } else {
      y = minp * vp[j];
      sum -= y;
      j++;
    }
  }
  if (sum >= 0 && t <= 0) return true;
  return false;
}
void print(int day) {
  long long t, i = 1, j, sum, x, y, dayx, dayy;
  long long mind = 100000000;
  long long minp = 100000000;
  for (i = 1; i <= day; i++) {
    if (d[i] < mind) {
      mind = d[i];
      dayx = i;
    }
    if (p[i] < minp) {
      dayy = i;
      minp = p[i];
    }
  }
  t = k, i = 0, j = 0;
  while (t--) {
    if (i < dm && j < pm) {
      x = mind * vd[i];
      y = minp * vp[j];
      if (x <= y) {
        dd[vd[i]]++;
        i++;
      } else {
        pp[vp[j]]++;
        j++;
      }
    } else if (i < dm) {
      x = mind * vd[i];
      dd[vd[i]]++;
      i++;
    } else {
      y = minp * vp[j];
      pp[vp[j]]++;
      j++;
    }
  }
  for (i = 1; i <= m; i++) {
    if (a[i].first == 1) {
      if (dd[a[i].second] > 0) {
        cout << i << " " << dayx << '\n';
        dd[a[i].second]--;
      }
    } else {
      if (pp[a[i].second] > 0) {
        cout << i << " " << dayy << '\n';
        pp[a[i].second]--;
      }
    }
  }
}
int solve() {
  int low = 1, high = n, mid, x = -1;
  while (low <= high) {
    mid = (low + high) / 2;
    if (check(mid)) {
      x = mid;
      high = mid - 1;
    } else
      low = mid + 1;
  }
  return x;
}
int main() {
  std::ios_base::sync_with_stdio(0);
  int cases, caseno = 0, i, j, t, cnt, sum;
  cin >> n >> m >> k >> s;
  for (i = 1; i <= n; i++) cin >> d[i];
  for (i = 1; i <= n; i++) cin >> p[i];
  for (i = 1; i <= m; i++) {
    cin >> j >> t;
    a[i] = make_pair(j, t);
    if (j == 1)
      vd[dm++] = t;
    else
      vp[pm++] = t;
  }
  sort(vd, vd + dm);
  sort(vp, vp + pm);
  int ans = solve();
  if (ans > -1) {
    cout << ans << '\n';
    print(ans);
  } else
    cout << ans;
  return 0;
}
