2 10 1 1 1
1
10
1
1 5 1 8
 4 4 1 0 1
1

1
1 2 1 4
 2 5 1 0 1
2

1
1 4 1 5
 10 10 1 8 4
10
2 3 4 5 6 7 8 9
10
1 1 3 1
2 1 7 1
1 1 9 1
7 1 4 1
10 1 7 1
2 1 7 1
3 1 2 1
5 1 2 1
10 1 5 1
6 1 9 1
 2 4 1 1 1
1
4
1
1 2 1 3
 2 2 0 1 1

1
1
1 2 2 2
 1000 1000 1 1 10
1
2
1
1 900 1 1000
 5 5 1 1 1
3
2
1
1 5 1 1
 2 4 1 1 1
1
2
1
2 3 2 4
 4 4 1 0 1
4

5
1 1 2 2
1 3 2 2
3 3 4 3
3 2 2 2
1 2 2 3

3
 2
 1
 3
4
4
3
3
4
3
3
4
3
 1
 3
 100
 4
 1
 6
4
3
5
4

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<ll> dlcost;
vector<ll> pdcost;
vector<ll> ditems, pitems;
int k;
bool checkBread(int lim, ll s) {
  vector<ll> allItems;
  for (ll v : ditems) allItems.push_back(dlcost[lim] * v);
  for (ll v : pitems) allItems.push_back(pdcost[lim] * v);
  sort(allItems.begin(), allItems.end());
  ll checksum = 0;
  for (int i = 0; i < k; ++i) checksum += allItems[i];
  return (checksum <= s);
}
int main() {
  int n, m;
  ll s;
  scanf("%d %d %d %lld", &n, &m, &k, &s);
  dlcost = pdcost = vector<ll>(n);
  for (int i = 0; i < n; ++i) scanf("%lld", &dlcost[i]);
  for (int i = 0; i < n; ++i) scanf("%lld", &pdcost[i]);
  vector<ll> dolMin(n), pouMin(n);
  for (int i = 1; i < n; ++i) {
    dlcost[i] = min(dlcost[i], dlcost[i - 1]);
    pdcost[i] = min(pdcost[i], pdcost[i - 1]);
    dolMin[i] = (dlcost[i] < dlcost[i - 1] ? i : dolMin[i - 1]);
    pouMin[i] = (pdcost[i] < pdcost[i - 1] ? i : pouMin[i - 1]);
  }
  vector<pair<int, int>> ogItems;
  for (int i = 0; i < m; ++i) {
    int t;
    ll c;
    scanf("%d %lld", &t, &c);
    ogItems.emplace_back(c, t);
    if (t == 1)
      ditems.push_back(c);
    else
      pitems.push_back(c);
  }
  int lo = 0, hi = n - 1;
  while (lo < hi) {
    int mid = (lo + hi) / 2;
    if (checkBread(mid, s))
      hi = mid;
    else
      lo = mid + 1;
  }
  if (!checkBread(lo, s)) {
    printf("-1\n");
  } else {
    printf("%d\n", lo + 1);
    for (int i = 0; i < m; ++i) {
      ogItems[i].first *= (ogItems[i].second == 1 ? dlcost[lo] : pdcost[lo]);
      ogItems[i].second = (ogItems[i].second == 1 ? i : -i - 1);
    }
    sort(ogItems.begin(), ogItems.end());
    for (int i = 0; i < k; ++i) {
      int x = ogItems[i].second;
      int id = (x < 0 ? -x - 1 : x);
      int day = (x >= 0 ? dolMin[lo] : pouMin[lo]);
      printf("%d %d\n", id + 1, day + 1);
    }
  }
  return 0;
}
