#include <bits/stdc++.h>
#pragma GCC optimize("-O3")
#pragma warning(disable : 4996);
const long long mod = 1e9 + 7;
const int iinf = (int)1e9;
const long long inf = (long long)1e18;
const double eps = (double)0.000001;
using namespace std;
template <class T, class T1>
void res(vector<T>& v, long long n, T1 a) {
  v.assign(n, a);
}
template <class T, class T1>
void res(vector<vector<T>>& v, long long n, long long m, T1 a) {
  v.assign(n, vector<T>(m, a));
}
template <class T, class T1>
void res(vector<vector<vector<T>>>& v, long long n, long long m, long long z,
         T1 a) {
  v.assign(n, vector<vector<T>>(m, vector<T>(z, a)));
}
void file_input() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
const long long N = 2 * 1e5 + 1;
long long i, j, n, m, k, l, r, sum, ql, qr, s, m1, m2;
vector<long long> a(N), b(N), ma(N, iinf), mb(N, iinf);
vector<pair<long long, long long>> t1, t2;
map<pair<long long, long long>, long long> mp;
vector<long long> ans1, ans2;
bool check(long long q) {
  ans1.clear();
  ans2.clear();
  m1 = ma[q];
  m2 = mb[q];
  long long sum = s;
  long long l, r;
  l = r = 0;
  for (i = 1; i <= k; i++) {
    if (t1.size() && t2.size() && l < t1.size() && r < t2.size() &&
        t1[l].first * m1 <= t2[r].first * m2) {
      ans1.emplace_back(t1[l].second);
      sum -= t1[l].first * m1;
      l++;
    } else if (t1.size() && t2.size() && l < t1.size() && r < t2.size() &&
               t1[l].first * m1 >= t2[r].first * m2) {
      ans2.emplace_back(t2[r].second);
      sum -= t2[r].first * m2;
      r++;
    } else if (!t1.size() || t1.size() == l) {
      ans2.emplace_back(t2[r].second);
      sum -= t2[r].first * m2;
      r++;
    } else {
      ans1.emplace_back(t1[l].second);
      sum -= t1[l].first * m1;
      l++;
    }
  }
  return sum >= 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> k >> s;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    ma[i] = ((ma[i - 1]) < (a[i]) ? (ma[i - 1]) : (a[i]));
  }
  for (i = 1; i <= n; i++) {
    cin >> b[i];
    mb[i] = ((mb[i - 1]) < (b[i]) ? (mb[i - 1]) : (b[i]));
  }
  for (i = 1; i <= m; i++) {
    long long type, v1;
    cin >> type >> v1;
    if (type == 1)
      t1.emplace_back(v1, i);
    else
      t2.emplace_back(v1, i);
  }
  sort((t1).begin(), (t1).end());
  sort((t2).begin(), (t2).end());
  long long l = 0, r = n;
  while (l < r - 1) {
    long long m = (l + r) / 2;
    if (check(m))
      r = m;
    else
      l = m;
  }
  if (!check(n)) {
    cout << -1;
    return 0;
  }
  cout << r;
  cout << "\n";
  long long w = check(r);
  for (i = 1; i <= n; i++) {
    if (m1 == a[i]) {
      m1 = i;
      break;
    }
  }
  for (i = 1; i <= n; i++) {
    if (m2 == b[i]) {
      m2 = i;
      break;
    }
  }
  for (auto r : ans1) {
    cout << r << ' ' << m1;
    cout << "\n";
  }
  for (auto r : ans2) {
    cout << r << ' ' << m2;
    cout << "\n";
  }
}
