#include <bits/stdc++.h>
using namespace std;
int read();
int n, m, p;
int a[300005];
struct P {
  int cnt, v[5], c[5];
} res;
P operator+(P &x, P &y) {
  if (!x.cnt) return y;
  if (!y.cnt) return x;
  P z = x;
  for (int i = 0; i < y.cnt; ++i) {
    bool flag = 0;
    for (int j = 0; j < z.cnt; ++j)
      if (z.v[j] == y.v[i]) {
        z.c[j] += y.c[i], flag = 1;
        break;
      }
    if (flag) continue;
    if (z.cnt < p) {
      z.v[z.cnt] = y.v[i], z.c[z.cnt++] = y.c[i];
      continue;
    }
    int k = 0;
    for (int j = 1; j < z.cnt; ++j)
      if (z.c[j] < z.c[k]) k = j;
    if (y.c[i] < z.c[k]) {
      for (int j = 0; j < z.cnt; ++j) z.c[j] -= y.c[i];
      continue;
    }
    int tc = z.c[k];
    z.v[k] = y.v[i], z.c[k] = y.c[i];
    for (int j = 0; j < z.cnt; ++j) z.c[j] -= tc;
  }
  return z;
}
struct Seg {
  P t[600005];
  int tag1[600005];
  void Tag1(int k, int v, int len) {
    t[k].cnt = 1, tag1[k] = t[k].v[0] = v, t[k].c[0] = len;
  }
  void psd(int k, int len) {
    if (tag1[k]) {
      Tag1(k << 1, tag1[k], len + 1 >> 1);
      Tag1(k << 1 | 1, tag1[k], len >> 1);
      tag1[k] = 0;
    }
  }
  void build(int l, int r, int k) {
    if (l == r) return Tag1(k, a[l], 1);
    int mid = l + r >> 1;
    build(l, mid, k << 1), build(mid + 1, r, k << 1 | 1),
        t[k] = t[k << 1] + t[k << 1 | 1];
  }
  void modi(int l, int r, int k, int st, int en, int v) {
    if (st > r || en < l) return;
    if (st <= l && en >= r) return Tag1(k, v, r - l + 1);
    psd(k, r - l + 1);
    int mid = l + r >> 1;
    modi(l, mid, k << 1, st, en, v), modi(mid + 1, r, k << 1 | 1, st, en, v);
    t[k] = t[k << 1] + t[k << 1 | 1];
  }
  void qry(int l, int r, int k, int st, int en) {
    if (st > r || en < l) return;
    if (st <= l && r <= en) return res = res + t[k], void();
    int mid = l + r >> 1;
    psd(k, r - l + 1), qry(l, mid, k << 1, st, en),
        qry(mid + 1, r, k << 1 | 1, st, en);
  }
} seg;
int main() {
  n = read(), m = read(), p = 100 / read();
  for (int i = 1; i <= n; ++i) a[i] = read();
  seg.build(1, n, 1);
  for (int i = 1, l, r, v; i <= m; ++i) {
    int op = read();
    if (op == 1) l = read(), r = read(), v = read(), seg.modi(1, n, 1, l, r, v);
    if (op == 2) {
      res.cnt = 0, l = read(), r = read(), seg.qry(1, n, 1, l, r);
      printf("%d", res.cnt);
      for (int i = 0; i < res.cnt; ++i) printf(" %d", res.v[i]);
      puts("");
    }
  }
  return 0;
}
const int _SIZE = 1 << 22;
char ibuf[_SIZE], *iS = ibuf, *iT = ibuf;
int read() {
  int x = 0, f = 1;
  char c = (iS == iT ? iT = ((iS = ibuf) + fread(ibuf, 1, _SIZE, stdin)),
            (iS == iT ? EOF : *iS++) : *iS++);
  while (!isdigit(c))
    f = (c == '-') ? -1 : f,
    c = (iS == iT ? iT = ((iS = ibuf) + fread(ibuf, 1, _SIZE, stdin)),
         (iS == iT ? EOF : *iS++) : *iS++);
  while (isdigit(c))
    x = x * 10 + c - '0',
    c = (iS == iT ? iT = ((iS = ibuf) + fread(ibuf, 1, _SIZE, stdin)),
         (iS == iT ? EOF : *iS++) : *iS++);
  return x * f;
}
