#include <bits/stdc++.h>
template <class T>
void pc(const T& v, const std::string c = "v:", std::ostream& s = std::cout) {
  std::cout << c << "\n";
  for (const auto x : v) {
    std::cout << x << " ";
  }
  std::cout << "\n";
}
std::vector<std::pair<int, int>> cum_min(const std::vector<int>& v) {
  std::vector<std::pair<int, int>> res;
  if (v.empty()) {
    return res;
  }
  res.push_back(std::make_pair(v[0], 0));
  for (int i = 1; i < v.size(); ++i) {
    if (v[i] < res.back().first) {
      res.push_back(std::make_pair(v[i], i));
    } else {
      res.push_back(res.back());
    }
  }
  return res;
}
std::vector<int> cum_sum(const std::vector<std::pair<int, int>> v) {
  std::vector<int> res(1, 0);
  for (int i = 0; i < v.size(); ++i) {
    res.push_back(res.back() + v[i].first);
  }
  return res;
}
struct cost_calc_res {
  cost_calc_res() : cost(std::numeric_limits<unsigned long long int>::max()) {}
  cost_calc_res(unsigned long long int cost, int usd_gadgets, int pound_gadgets,
                int usd_day, int pound_day)
      : cost(cost),
        usd_gadgets(usd_gadgets),
        pound_gadgets(pound_gadgets),
        usd_day(usd_day),
        pound_day(pound_day) {}
  unsigned long long int cost;
  int usd_gadgets;
  int pound_gadgets;
  int usd_day;
  int pound_day;
};
cost_calc_res cost_on_day(int day, int need_gadgets,
                          const std::vector<int>& usd_gadgets_cum,
                          const std::vector<std::pair<int, int>>& usd_min,
                          const std::vector<int>& pound_gadgets_cum,
                          const std::vector<std::pair<int, int>>& pound_min) {
  int usd_price = usd_min[day].first;
  int pound_price = pound_min[day].first;
  int usd_day = usd_min[day].second;
  int pound_day = pound_min[day].second;
  unsigned long long int res =
      std::numeric_limits<unsigned long long int>::max();
  int res_pound_gadgets = -1;
  int res_usd_gadgets = -1;
  for (int i = 0; i <= need_gadgets; ++i) {
    int usd_gadgets_num = need_gadgets - i;
    int pound_gadgets_num = i;
    if (usd_gadgets_cum.size() < usd_gadgets_num + 1 ||
        pound_gadgets_cum.size() < pound_gadgets_num + 1) {
      continue;
    }
    unsigned long long int cur_cost =
        (unsigned long long int)usd_gadgets_cum[usd_gadgets_num] * usd_price +
        (unsigned long long int)pound_gadgets_cum[pound_gadgets_num] *
            pound_price;
    if (cur_cost < res) {
      res = cur_cost;
      res_usd_gadgets = usd_gadgets_num;
      res_pound_gadgets = pound_gadgets_num;
    }
  }
  return cost_calc_res(res, res_usd_gadgets, res_pound_gadgets, usd_day,
                       pound_day);
}
int main() {
  int days, total_gadets, need_gadgets;
  std::cin >> days >> total_gadets >> need_gadgets;
  unsigned long long int rubs;
  std::cin >> rubs;
  std::vector<int> usd, pound;
  for (int i = 0; i < days; ++i) {
    int t;
    std::cin >> t;
    usd.push_back(t);
  }
  for (int i = 0; i < days; ++i) {
    int t;
    std::cin >> t;
    pound.push_back(t);
  }
  std::vector<std::pair<int, int>> usd_min = cum_min(usd);
  std::vector<std::pair<int, int>> pound_min = cum_min(pound);
  std::vector<std::pair<int, int>> usd_gadgets;
  std::vector<std::pair<int, int>> pound_gadgets;
  for (int i = 0; i < total_gadets; ++i) {
    int t, c;
    std::cin >> t >> c;
    if (t == 1) {
      usd_gadgets.push_back(std::make_pair(c, i));
    } else if (t == 2) {
      pound_gadgets.push_back(std::make_pair(c, i));
    }
  }
  std::sort(usd_gadgets.begin(), usd_gadgets.end());
  std::sort(pound_gadgets.begin(), pound_gadgets.end());
  std::vector<int> usd_gadgets_cum = cum_sum(usd_gadgets);
  std::vector<int> pound_gadgets_cum = cum_sum(pound_gadgets);
  cost_calc_res cur_res;
  int buy_day_left = 0;
  int buy_day_right = days;
  while (true) {
    int buy_day = (buy_day_left + buy_day_right - 1) / 2;
    cur_res = cost_on_day(buy_day, need_gadgets, usd_gadgets_cum, usd_min,
                          pound_gadgets_cum, pound_min);
    if (cur_res.cost <= rubs) {
      buy_day_right = buy_day + 1;
    } else {
      buy_day_left = buy_day + 1;
    }
    if (buy_day_right - buy_day_left <= 1) {
      break;
    }
  }
  cur_res = cost_on_day(buy_day_left, need_gadgets, usd_gadgets_cum, usd_min,
                        pound_gadgets_cum, pound_min);
  if (cur_res.cost > rubs) {
    std::cout << -1 << "\n";
    return 0;
  }
  std::cout << buy_day_left + 1 << "\n";
  for (int i = 0; i < cur_res.usd_gadgets; ++i) {
    std::cout << usd_gadgets[i].second + 1 << " " << cur_res.usd_day + 1
              << "\n";
  }
  for (int i = 0; i < cur_res.pound_gadgets; ++i) {
    std::cout << pound_gadgets[i].second + 1 << " " << cur_res.pound_day + 1
              << "\n";
  }
  return 0;
}
