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>
inline int read() {
  char c;
  int x;
  for (c = getchar(); !isdigit(c); c = getchar())
    ;
  for (x = 0; isdigit(c); c = getchar()) {
    x = x * 10 + c - '0';
  }
  return x;
}
const int N = 1e6 + 5;
int n, p, q, k, a[N];
std::vector<std::pair<int, int>> operator+(std::vector<std::pair<int, int>> f,
                                           std::vector<std::pair<int, int>> g) {
  for (auto &x : g) {
    for (int i = 0; i < f.size(); i++) {
      if (f[i].second == x.second) {
        f[i].first += x.first;
        x.first = 0;
      }
    }
  }
  for (auto x : g) {
    if (x.first != 0) {
      f.push_back(x);
    }
  }
  std::sort(f.begin(), f.end());
  std::reverse(f.begin(), f.end());
  for (; f.size() >= k; f.pop_back()) {
    for (int i = (int)f.size() - k; i < f.size(); i++) {
      f[i].first -= f.back().first;
    }
  }
  for (; !f.empty() && f.back().first == 0; f.pop_back())
    ;
  return f;
}
struct SegmentTree {
  std::vector<std::pair<int, int>> f[N];
  int tag[N], len[N];
  inline void pushUp(int u) {
    int ls = u << 1, rs = ls | 1;
    f[u] = f[ls] + f[rs];
  }
  inline void pushTag(int u, int x) {
    f[u] = std::vector<std::pair<int, int>>(1, {len[u], x});
    tag[u] = x;
  }
  inline void pushDown(int u) {
    if (tag[u] == -1) {
      return;
    }
    int ls = u << 1, rs = ls | 1;
    pushTag(ls, tag[u]);
    pushTag(rs, tag[u]);
    tag[u] = -1;
  }
  void build(int u, int l, int r) {
    len[u] = r - l;
    tag[u] = -1;
    if (l + 1 >= r) {
      pushTag(u, a[l]);
      return;
    }
    int mid = l + r >> 1, ls = u << 1, rs = ls | 1;
    build(ls, l, mid);
    build(rs, mid, r);
    pushUp(u);
  }
  void modify(int u, int l, int r, int pl, int pr, int x) {
    if (pl >= pr) {
      return;
    }
    if (l == pl && r == pr) {
      pushTag(u, x);
      return;
    }
    int mid = l + r >> 1, ls = u << 1, rs = ls | 1;
    pushDown(u);
    if (pr <= mid) {
      modify(ls, l, mid, pl, pr, x);
    } else if (pl >= mid) {
      modify(rs, mid, r, pl, pr, x);
    } else {
      modify(ls, l, mid, pl, mid, x);
      modify(rs, mid, r, mid, pr, x);
    }
    pushUp(u);
  }
  void query(int u, int l, int r, int pl, int pr,
             std::vector<std::pair<int, int>> &res) {
    if (pl >= pr) {
      return;
    }
    if (l == pl && r == pr) {
      res = res + f[u];
      return;
    }
    int mid = l + r >> 1, ls = u << 1, rs = ls | 1;
    pushDown(u);
    if (pr <= mid) {
      query(ls, l, mid, pl, pr, res);
    } else if (pl >= mid) {
      query(rs, mid, r, pl, pr, res);
    } else {
      query(ls, l, mid, pl, mid, res);
      query(rs, mid, r, mid, pr, res);
    }
    pushUp(u);
  }
} smt;
int main() {
  n = read();
  q = read();
  p = read();
  k = 100 / p + 1;
  for (int i = 0; i < n; i++) {
    a[i] = read();
  }
  smt.build(1, 0, n);
  for (int i = 0; i < q; i++) {
    int opt = read();
    if (opt == 1) {
      int l = read(), r = read(), x = read();
      l--;
      smt.modify(1, 0, n, l, r, x);
    } else {
      int l = read(), r = read();
      l--;
      std::vector<std::pair<int, int>> ans;
      smt.query(1, 0, n, l, r, ans);
      printf("%d", ans.size());
      for (auto x : ans) {
        printf(" %d", x.second);
      }
      printf("\n");
    }
  }
  return 0;
}