#include <bits/stdc++.h>
using namespace std;
long long int min_ex_rate_d[200001], min_ex_rate_p[200001];
long long int min_ex_rate_d_idx[200001], min_ex_rate_p_idx[200001];
long long int days, gads, req_gad, money;
vector<pair<long long int, long long int>> gad_d, gad_p;
vector<long long int> sum_gad_d, sum_gad_p;
long long int min(long long int a, long long int b) { return a < b ? a : b; }
pair<long long int, long long int> calculate_req_money(
    const long long int day) {
  const long long int& d_ex_rate = min_ex_rate_d[day];
  const long long int& p_ex_rate = min_ex_rate_p[day];
  long long int ret = 1987654321;
  long long int dollar_cnt = -1;
  for (long long int dollar_req_cnt = 0; dollar_req_cnt <= req_gad;
       dollar_req_cnt++) {
    const long long int pound_req_cnt = req_gad - dollar_req_cnt;
    if (dollar_req_cnt > gad_d.size() || pound_req_cnt > gad_p.size()) continue;
    const long long int now_money =
        (1 <= dollar_req_cnt
             ? (sum_gad_d[dollar_req_cnt - 1] * min_ex_rate_d[day])
             : 0) +
        (1 <= pound_req_cnt
             ? (sum_gad_p[pound_req_cnt - 1] * min_ex_rate_p[day])
             : 0);
    if (now_money > 0 && ret > now_money) {
      ret = now_money;
      dollar_cnt = dollar_req_cnt;
    }
  }
  return make_pair(ret, dollar_cnt);
}
long long int find(long long int left, long long int right) {
  long long int mid = (left + right) / 2;
  if (left == mid) {
    if (calculate_req_money(left).first <= money) {
      return left;
    }
    if (calculate_req_money(right).first <= money) {
      return right;
    }
    return -1;
  }
  if (calculate_req_money(mid).first <= money) {
    return find(left, mid);
  } else {
    return find(mid, right);
  }
  return -2;
}
int main(void) {
  scanf("%lld %lld %lld %lld", &days, &gads, &req_gad, &money);
  min_ex_rate_d[0] = 1987654321;
  min_ex_rate_p[0] = 1987654321;
  for (int i = 1; i <= days; i++) {
    long long int now_ex_rate;
    scanf("%lld", &now_ex_rate);
    if (min_ex_rate_d[i - 1] > now_ex_rate) {
      min_ex_rate_d[i] = now_ex_rate;
      min_ex_rate_d_idx[i] = i;
    } else {
      min_ex_rate_d[i] = min_ex_rate_d[i - 1];
      min_ex_rate_d_idx[i] = min_ex_rate_d_idx[i - 1];
    }
  }
  for (int i = 1; i <= days; i++) {
    long long int now_ex_rate;
    scanf("%lld", &now_ex_rate);
    if (min_ex_rate_p[i - 1] > now_ex_rate) {
      min_ex_rate_p[i] = now_ex_rate;
      min_ex_rate_p_idx[i] = i;
    } else {
      min_ex_rate_p[i] = min_ex_rate_p[i - 1];
      min_ex_rate_p_idx[i] = min_ex_rate_p_idx[i - 1];
    }
  }
  for (int i = 1; i <= gads; i++) {
    long long int type, ex_rate;
    scanf("%lld %lld", &type, &ex_rate);
    if (type == 1) {
      gad_d.push_back({ex_rate, i});
    } else {
      gad_p.push_back({ex_rate, i});
    }
  }
  sort(gad_d.begin(), gad_d.end());
  sort(gad_p.begin(), gad_p.end());
  sum_gad_d = vector<long long int>(gad_d.size(), 0);
  sum_gad_p = vector<long long int>(gad_p.size(), 0);
  for (int i = 0; i < sum_gad_d.size(); i++) {
    sum_gad_d[i] = (i > 0 ? sum_gad_d[i - 1] : 0) + gad_d[i].first;
  }
  for (int i = 0; i < sum_gad_p.size(); i++) {
    sum_gad_p[i] = (i > 0 ? sum_gad_p[i - 1] : 0) + gad_p[i].first;
  }
  long long int ret = find(1, days);
  if (ret == -1) {
    printf("%d\n", -1);
  } else {
    printf("%lld\n", ret);
    pair<long long int, long long int> p_ret = calculate_req_money(ret);
    const long long int dollar_cnt = p_ret.second;
    for (long long int i = 0; i < dollar_cnt; i++) {
      printf("%lld %lld\n", gad_d[i].second, min_ex_rate_d_idx[ret]);
    }
    for (int i = 0; i < req_gad - dollar_cnt; i++) {
      printf("%lld %lld\n", gad_p[i].second, min_ex_rate_p_idx[ret]);
    }
  }
}
