Problem: One social network developer recently suggested a new algorithm of choosing ads for users.

There are n slots which advertisers can buy. It is possible to buy a segment of consecutive slots at once. The more slots you own, the bigger are the chances your ad will be shown to users.

Every time it is needed to choose ads to show, some segment of slots is picked by a secret algorithm. Then some advertisers are chosen. The only restriction is that it should be guaranteed for advertisers which own at least p% of slots composing this segment that their ad will be shown.

From the other side, users don't like ads. So it was decided to show no more than <image> ads at once. You are asked to develop a system to sell segments of slots and choose ads in accordance with the rules described above.

Input

The first line of the input contains three integers n, m and p (1 ≤ n, m ≤ 150 000, 20 ≤ p ≤ 100) — the number of slots, the number of queries to your system and threshold for which display of the ad is guaranteed.

Next line contains n integers ai (1 ≤ ai ≤ 150 000), where the i-th number means id of advertiser who currently owns the i-th slot.

Next m lines contain queries descriptions. Each description is of one of the following forms: 

  * 1 l r id (1 ≤ l ≤ r ≤ n, 1 ≤ id ≤ 150 000) — advertiser id bought all slots in a range from l to r inclusive; 
  * 2 l r (1 ≤ l ≤ r) — you need to choose advertisers for segment [l, r]. 

Output

For each query of the second type answer should be printed in a separate line. First integer of the answer should be the number of advertisements that will be shown <image>. Next cnt integers should be advertisers' ids. 

It is allowed to print one advertiser more than once, but each advertiser that owns at least <image> slots of the segment from l to r should be in your answer.

Example

Input

5 9 33
1 2 1 3 3
2 1 5
2 1 5
2 1 3
2 3 3
1 2 4 5
2 1 5
2 3 5
1 4 5 1
2 1 5


Output

3 1 2 3
2 1 3
2 2 1
3 1 1000 1000
1 5
2 5 3
2 1 5

Note

Samples demonstrate that you actually have quite a lot of freedom in choosing advertisers.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-all-loops")
using namespace std;
const int MAXBUF = 1 << 23;
char B[MAXBUF], *Si = B, *Ti = B;
inline char getc() {
  if (Si == Ti) Ti = (Si = B) + fread(B, 1, MAXBUF, stdin);
  if (Si == Ti)
    return 0;
  else
    return *Si++;
}
template <class T>
inline void read(T &a) {
  static char c;
  static int fh;
  while (((c = getc()) < '0' || c > '9') && c != '-')
    ;
  if (c == '-')
    fh = -1, a = 0;
  else
    fh = 1, a = c - '0';
  while ((c = getc()) <= '9' && c >= '0') a = (a << 3) + (a << 1) + c - '0';
  if (fh == -1) a = -a;
}
char Buff[MAXBUF], *sti = Buff;
template <class T>
inline void write(T a) {
  if (a == 0) {
    *sti++ = '0';
    return;
  }
  if (a < 0) *sti++ = '-', a = -a;
  static char c[20];
  static int c0;
  c0 = 0;
  while (a) c[c0++] = a % 10 + '0', a /= 10;
  while (c0--) *sti++ = c[c0];
}
const int sz = 405;
int a[150005], b[150005], n, m, p;
int tag[405], siz[405], num[150005][405];
int ch[105], vis[150005];
int tot[105], o[105][105];
int ans[15], cnt = 0;
bool ok[150005];
int seed = 23336666;
inline int rnd() {
  seed ^= (seed << 13);
  seed ^= (seed >> 17);
  seed ^= (seed << 5);
  return (seed < 0 ? -seed : seed);
}
inline void rebuild(int pos) {
  for (int i = (pos - 1) * sz + 1; i <= pos * sz && i <= n; i++) {
    num[a[i]][pos] = 0;
    a[i] = tag[pos];
  }
  num[tag[pos]][pos] = siz[pos];
  tag[pos] = 0;
}
inline void modify(int l, int r, int x) {
  int bl = (l - 1) / sz + 1, br = (r - 1) / sz + 1, i;
  if (bl == br) {
    if (tag[bl]) rebuild(bl);
    for (i = l; i <= r; i++) {
      num[a[i]][bl]--;
      num[x][bl]++;
      a[i] = x;
    }
    return;
  }
  for (i = bl + 1; i < br; i++) tag[i] = x;
  if (tag[bl]) rebuild(bl);
  for (i = l; i <= bl * sz; i++) {
    num[a[i]][bl]--;
    num[x][bl]++;
    a[i] = x;
  }
  if (tag[br]) rebuild(br);
  for (i = (br - 1) * sz + 1; i <= r; i++) {
    num[a[i]][br]--;
    num[x][br]++;
    a[i] = x;
  }
  return;
}
inline int ask(int pos) {
  int bl = (pos - 1) / sz + 1;
  if (tag[bl]) return tag[bl];
  return a[pos];
}
inline int ask(int l, int r, int x) {
  int bl = (l - 1) / sz + 1, br = (r - 1) / sz + 1, i, ret = 0;
  if (bl == br) {
    if (tag[bl] && tag[bl] == x) ret += r - l + 1;
    if (!tag[bl]) {
      for (i = l; i <= r; i++) {
        if (a[i] == x) ret++;
      }
    }
    return ret;
  }
  if (tag[bl] && tag[bl] == x) ret += bl * sz - l + 1;
  if (!tag[bl]) {
    for (i = l; i <= bl * sz; i++) {
      if (a[i] == x) ret++;
    }
  }
  if (tag[br] && tag[br] == x) ret += r - (br - 1) * sz;
  if (!tag[br]) {
    for (i = (br - 1) * sz + 1; i <= r; i++) {
      if (a[i] == x) ret++;
    }
  }
  for (i = bl + 1; i < br; i++) {
    if (!tag[i]) ret += num[x][i];
    if (tag[i] == x) ret += siz[i];
  }
  return ret;
}
int main() {
  int i, j, bl, opt, l, r, x;
  read(n);
  read(m);
  read(p);
  for (i = 1; i <= n; i++) {
    read(a[i]);
    bl = (i - 1) / sz + 1;
    num[a[i]][bl]++;
    siz[bl]++;
  }
  while (m--) {
    read(opt);
    read(l);
    read(r);
    cnt = 0;
    if (opt == 1) {
      read(x);
      modify(l, r, x);
      continue;
    }
    int tar = p * (r - l + 1) / 100;
    if ((p * (r - l + 1)) % 100) tar++;
    for (i = 1; i <= 100; i++) tot[i] = 0;
    for (i = 1; i <= 100; i++) {
      ch[i] = ask(rnd() % (r - l + 1) + l);
      vis[ch[i]]++;
    }
    for (i = 1; i <= 100; i++) {
      if (ok[ch[i]]) continue;
      ok[ch[i]] = 1;
      int bel = vis[ch[i]];
      o[bel][++tot[bel]] = ch[i];
    }
    int ban = 0, sum = 0;
    for (i = 100; i >= 3; i--) {
      for (j = 1; j <= tot[i]; j++) {
        int num = ask(l, r, o[i][j]);
        sum += num;
        if (num >= tar) {
          ans[++cnt] = o[i][j];
          ban = 0;
          continue;
        }
        ban++;
        if (ban >= 7 || cnt >= 5 || sum + tar > r - l + 1) break;
      }
      if (ban >= 7 || cnt >= 5 || sum + tar > r - l + 1) break;
    }
    write(cnt);
    *sti++ = ' ';
    for (i = 1; i <= cnt; i++) write(ans[i]), *sti++ = ' ';
    *sti++ = '\n';
    for (i = 1; i <= 100; i++) ok[ch[i]] = 0, vis[ch[i]] = 0;
  }
  fwrite(Buff, 1, sti - Buff, stdout);
  return 0;
}