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;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int &x, int y, int mod) {
  x += y;
  if (x >= mod) x -= mod;
}
void et() {
  puts("-1");
  exit(0);
}
int Q, p;
void mg(unordered_map<int, int> &c, unordered_map<int, int> &b) {
  for (auto p : b) c[p.first] += p.second;
  while (c.size() >= Q) {
    int i = 0, t = (1 << 30);
    vector<int> w;
    for (auto p : c)
      if (i < Q) {
        t = min(t, p.second);
        i++;
      }
    i = 0;
    for (auto &p : c)
      if (i < Q) {
        p.second -= t;
        if (p.second == 0) w.push_back(p.first);
        i++;
      }
    for (int who : w) c.erase(who);
  }
}
unordered_map<int, int> tr[150105 * 4];
int lz[150105 * 4], a[150105];
void up(int rt) {
  tr[rt].clear();
  mg(tr[rt], tr[(rt << 1)]);
  mg(tr[rt], tr[(rt << 1 | 1)]);
}
void down(int rt, int l, int r) {
  if (lz[rt] != 0) {
    int id = lz[rt];
    tr[(rt << 1)].clear();
    int mid = (l + r) / 2;
    tr[(rt << 1)][id] = mid - l;
    lz[(rt << 1)] = id;
    tr[(rt << 1 | 1)].clear();
    tr[(rt << 1 | 1)][id] = r - mid;
    lz[(rt << 1 | 1)] = id;
    lz[rt] = 0;
  }
}
void build(int rt, int l, int r) {
  if (l + 1 == r) {
    tr[rt][a[r]] = 1;
    return;
  }
  int mid = (l + r) / 2;
  build((rt << 1), l, mid);
  build((rt << 1 | 1), mid, r);
  up(rt);
}
void upt(int rt, int l, int r, int L, int R, int id) {
  if (R <= l || r <= L) return;
  if (L <= l && r <= R) {
    tr[rt].clear();
    tr[rt][id] = r - l;
    lz[rt] = id;
    return;
  }
  down(rt, l, r);
  int mid = (l + r) / 2;
  upt((rt << 1), l, mid, L, R, id);
  upt((rt << 1 | 1), mid, r, L, R, id);
  up(rt);
}
unordered_map<int, int> z;
void qy(int rt, int l, int r, int L, int R) {
  if (R <= l || r <= L) return;
  if (L <= l && r <= R) {
    mg(z, tr[rt]);
    return;
  }
  down(rt, l, r);
  int mid = (l + r) / 2;
  qy((rt << 1), l, mid, L, R);
  qy((rt << 1 | 1), mid, r, L, R);
}
void fmain() {
  scanf("%d%d%d", &n, &m, &p);
  Q = 100 / p + 1;
  for (int(i) = 1; (i) <= (int)(n); (i)++) scanf("%d", a + i);
  build(1, 0, n);
  for (int ty, i = 0, l, r, id; i < m; i++) {
    scanf("%d%d%d", &ty, &l, &r);
    if (ty == 1) {
      scanf("%d", &id);
      upt(1, 0, n, l - 1, r, id);
    } else {
      z.clear();
      qy(1, 0, n, l - 1, r);
      printf("%d ", z.size());
      for (auto p : z) printf("%d ", p.first);
      puts("");
    }
  }
}
int main() {
  fmain();
  return 0;
}