#include <bits/stdc++.h>
using namespace std;
const int inft = 1000000009;
const int MAXN = 100005;
long long A[MAXN];
struct op {
  int typ, nr, ile, input;
  long long li, mi;
  op() {}
  op(int _typ, int _nr, int _ile, long long _li, long long _mi, int _input) {
    typ = _typ;
    nr = _nr;
    ile = _ile;
    li = _li;
    mi = _mi;
    input = _input;
  }
  bool operator<(const op &B) const {
    assert(li && mi && B.li && B.mi);
    return 1.0 * li / mi < 1.0 * B.li / B.mi;
  }
};
bool cmpile(const op &a, const op &b) {
  if (a.ile != b.ile) return a.ile < b.ile;
  return a.nr < b.nr;
}
vector<op> V[MAXN];
priority_queue<op> PQ;
int sset[MAXN];
int kto[MAXN];
void add(int p) {
  if (V[p].empty()) return;
  op q = V[p].back();
  V[p].pop_back();
  ;
  PQ.push(op(q.typ, q.nr, q.ile, A[p] + q.ile, A[p], q.input));
}
int main() {
  int n, moge, typy;
  scanf("%d%d%d", &n, &typy, &moge);
  for (int i = 0; i < (n); ++i) scanf("%lld", &A[i]);
  for (int i = 0; i < (n); ++i) sset[i] = A[i];
  for (int i = 0; i < (n); ++i) kto[i] = -1;
  for (int i = 0; i < (typy); ++i) {
    int t, b, c;
    scanf("%d%d%d", &t, &b, &c);
    --b;
    if (t == 3) PQ.push(op(t, b, c, c, 1, i));
    if (t == 2) V[b].push_back(op(t, b, c, 0, 0, i));
    if (t == 1 && sset[b] < c) {
      sset[b] = c;
      kto[b] = i;
    }
  }
  for (int i = 0; i < (n); ++i)
    if (kto[i] != -1) {
      ;
      V[i].push_back(op(1, i, sset[i] - A[i], 0, 0, kto[i]));
    }
  for (int i = 0; i < (n); ++i) sort(V[i].begin(), V[i].end(), cmpile);
  for (int i = 0; i < (n); ++i) add(i);
  vector<pair<int, int> > ANS;
  for (int i = 0; i < (moge); ++i) {
    if (PQ.empty()) break;
    op AA = PQ.top();
    ;
    PQ.pop();
    ANS.push_back(pair<int, int>(AA.typ, AA.input));
    if (AA.typ != 3) {
      A[AA.nr] += AA.ile;
      add(AA.nr);
    }
  }
  sort((ANS).begin(), (ANS).end());
  printf("%d\n", (int)ANS.size());
  for (typeof((ANS).begin()) it = (ANS).begin(); it != (ANS).end(); ++it)
    printf("%d ", it->second + 1);
  printf("\n");
  return 0;
}
