#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
namespace input {
inline int nextInt() {
  int res = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') res = res * 10 + c - '0', c = getchar();
  return res;
}
inline long long nextLong() {
  long long res = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') res = res * 10 + c - '0', c = getchar();
  return res;
}
inline bool isSpace(const char &c) {
  return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
inline void next(char *str) {
  char c = getchar();
  while (isSpace(c)) c = getchar();
  size_t head = 0;
  while (!isSpace(c)) str[head++] = c, c = getchar();
  str[head] = 0;
}
inline char nextChar() {
  char c = getchar();
  while (isSpace(c)) c = getchar();
  return c;
}
}  // namespace input
using namespace input;
const int N = 2e5 + 5;
int a[N], b[N], t[N], c[N];
int n, m, k, s;
char was[N];
const int oo = 1e9;
bool check(int day) {
  int minD = oo;
  int minF = oo;
  for (int i = 1; i <= day; i++) {
    minD = min(minD, a[i]);
    minF = min(minF, b[i]);
  }
  long long sum = 0LL;
  priority_queue<pair<long long, int> > q;
  memset(was, 0, sizeof(was));
  for (int i = 0; i < m; i++) {
    if (t[i] == 1) {
      q.push(make_pair(-minD * 1LL * c[i], i));
    } else {
      q.push(make_pair(-minF * 1LL * c[i], i));
    }
  }
  for (int i = 0; i < k;) {
    if (was[q.top().second] == false) {
      long long cur = -(q.top().first);
      sum += cur;
      was[q.top().second] = true;
      i++;
    }
    q.pop();
  }
  if (sum <= s)
    return true;
  else
    return false;
}
int g[N], d[N];
void ans(int day) {
  int minD = oo, dday = 1;
  int minF = oo, fday = 1;
  for (int i = 1; i <= day; i++) {
    if (a[i] < minD) {
      minD = a[i];
      dday = i;
    }
    if (b[i] < minF) {
      minF = b[i];
      fday = i;
    }
  }
  priority_queue<pair<long long, int> > q;
  memset(was, 0, sizeof(was));
  for (int i = 0; i < m; i++) {
    if (t[i] == 1) {
      q.push(make_pair(-minD * 1LL * c[i], i));
    } else {
      q.push(make_pair(-minF * 1LL * c[i], i));
    }
  }
  int pos = 0;
  for (int i = 0; i < k;) {
    if (was[q.top().second] == false) {
      g[pos] = q.top().second;
      if (t[g[pos]] == 1) {
        d[pos] = dday;
      } else {
        d[pos] = fday;
      }
      pos++;
      was[q.top().second] = true;
      i++;
    }
    q.pop();
  }
}
void solve() {
  n = nextInt();
  m = nextInt();
  k = nextInt();
  s = nextInt();
  for (int i = 1; i <= n; i++) {
    a[i] = nextInt();
  }
  for (int i = 1; i <= n; i++) {
    b[i] = nextInt();
  }
  for (int i = 0; i < m; i++) {
    t[i] = nextInt();
    c[i] = nextInt();
  }
  int left = 1, right = n + 1;
  while (left < right) {
    int middle = (left + right) >> 1;
    if (check(middle))
      right = middle;
    else
      left = middle + 1;
  }
  if (left == n + 1) {
    puts("-1");
  } else {
    ans(left);
    printf("%d\n", left);
    for (int i = 0; i < k; i++) {
      printf("%d %d\n", g[i] + 1, d[i]);
    }
  }
}
