#include <bits/stdc++.h>
using namespace std;
int read() {
  int w = 0, f = 1;
  char c = ' ';
  while (c < '0' || c > '9') c = getchar(), f = c == '-' ? -1 : f;
  while (c >= '0' && c <= '9') w = w * 10 + c - 48, c = getchar();
  return w * f;
}
mt19937 rnd(time(NULL) ^ clock());
int rad(int x, int y) { return rnd() % (y - x + 1) + x; }
int n, m, p, a[150005], bl[150005 / 390 + 5], br[150005 / 390 + 5], b[150005],
    tag[150005 / 390 + 5], now[1005], cnt[150005];
void init() {
  for (int i = 1; (i - 1) * 390 < n; i++) {
    bl[i] = (i - 1) * 390 + 1, br[i] = min(i * 390, n);
    for (int j = bl[i]; j <= br[i]; j++) b[j] = i;
  }
}
void pushdown(int p) {
  if (!tag[p]) return;
  for (int i = bl[p]; i <= br[p]; i++) a[i] = tag[p];
  tag[p] = 0;
}
void update(int l, int r, int v) {
  int L = b[l], R = b[r];
  if (L == R) {
    pushdown(L);
    for (int i = l; i <= r; i++) a[i] = v;
    return;
  }
  pushdown(L);
  pushdown(R);
  for (int i = l; i <= br[L]; i++) a[i] = v;
  for (int i = bl[R]; i <= r; i++) a[i] = v;
  L++, R--;
  for (int i = L; i <= R; i++) tag[i] = v;
}
int query(int x) { return tag[b[x]] ? tag[b[x]] : a[x]; }
signed main() {
  n = read(), m = read(), p = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  init();
  int op, l, r;
  while (m--) {
    op = read(), l = read(), r = read();
    if (op == 1)
      update(l, r, read());
    else {
      int tot = 0;
      for (int i = 1; i < 1005; i++) {
        int x = query(rad(l, r));
        if (!cnt[x]) now[++tot] = x;
        cnt[x]++;
      }
      sort(now + 1, now + tot + 1,
           [&](int x, int y) { return cnt[x] > cnt[y]; });
      int y = min(100 / p, tot);
      printf("%d ", y);
      for (int i = 1; i <= y; i++) printf("%d%c", now[i], i == y ? '\n' : ' ');
      for (int i = 1; i <= tot; i++) cnt[now[i]] = 0;
    }
  }
  return 0;
}
