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>
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;
}