#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
long long n, m, k, x, y, z;
bool sortbysec(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (a.second < b.second);
}
bool sortbyfi(const pair<long long, pair<long long, long long>> &a,
              const pair<long long, pair<long long, long long>> &b) {
  return (a.first > b.first);
}
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>>
    pq;
vector<std::pair<long long, long long>> c;
long long d[200005], p[200005];
bool pdt(long long day, long long s) {
  long long it1 = 0, it2 = 0;
  long long mn1 = 2e10, mn2 = 2e10;
  for (long long i = 0; i <= day; i++) {
    if (d[i] < mn1) mn1 = d[i];
    if (p[i] < mn2) mn2 = p[i];
  }
  vector<long long> cost;
  for (long long i = 0; i < m; i++) {
    if (c[i].first == 1)
      cost.push_back(mn1 * c[i].second);
    else
      cost.push_back(mn2 * c[i].second);
  }
  sort(cost.begin(), cost.end());
  for (long long i = 0; i < cost.size(); i++) {
    if (cost[i] > s) return false;
    s -= cost[i];
    if (i + 1 == k) return true;
  }
}
void Birdperson() {
  long long s;
  cin >> n >> m >> k >> s;
  for (long long i = 0; i < n; i++) cin >> d[i];
  for (long long i = 0; i < n; i++) cin >> p[i];
  for (long long i = 0; i < m; i++) {
    cin >> x >> y;
    c.push_back({x, y});
  }
  long long it1 = 0, it2 = 0, days = 0;
  vector<std::pair<long long, long long>> ans;
  long long hi = n - 1, lo = 0;
  while (hi > lo) {
    long long mid = lo + (hi - lo) / 2;
    if (pdt(mid, s))
      hi = mid;
    else
      lo = mid + 1;
  }
  long long mn1 = 2e10, mn2 = 2e10, n1, n2;
  for (long long i = 0; i <= lo; i++) {
    if (d[i] < mn1) mn1 = d[i], n1 = i + 1;
    if (p[i] < mn2) mn2 = p[i], n2 = i + 1;
  }
  vector<pair<long long, pair<long long, long long>>> cost;
  for (long long i = 0; i < m; i++) {
    if (c[i].first == 1)
      cost.push_back({c[i].second * mn1, {i + 1, 1}});
    else
      cost.push_back({c[i].second * mn2, {i + 1, 2}});
  }
  sort(cost.begin(), cost.end());
  for (long long i = 0; i < cost.size(); i++) {
    if (cost[i].first > s) break;
    s -= cost[i].first;
    k--;
    if (cost[i].second.second == 1)
      ans.push_back({cost[i].second.first, n1});
    else
      ans.push_back({cost[i].second.first, n2});
    if (k == 0) break;
  }
  if (k != 0) {
    cout << -1 << "\n";
  } else {
    cout << lo + 1 << "\n";
    for (auto i : ans) cout << (i.first) << " " << (i.second) << "\n";
  }
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    Birdperson();
  }
  return 0;
}
