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 long long read() {
  long long res = 0, bo = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') bo = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    res = (res << 1) + (res << 3) + ch - '0';
    ch = getchar();
  }
  return bo * res;
}
template <typename T>
void read(T &x) {
  x = read();
}
template <typename T, typename... Argv>
void read(T &a, Argv &...argv) {
  read(a);
  read(argv...);
}
int p, limit;
struct data {
  int color, size;
  friend bool operator<(const data &a, const data &b) {
    return a.size > b.size;
  }
  data() { color = size = 0; }
  data(int color, int size) : color(color), size(size) {}
};
struct Node {
  data a[5];
  int size, len;
  Node() { size = len = 0; }
  void init(int color, int size) {
    a[0] = data(color, size);
    this->size = 1;
  }
  friend Node operator+(const Node &a, const Node &b) {
    data tmp[10];
    int Size = 0;
    Node res;
    res.size = 0;
    res.len = a.len + b.len;
    int least = (res.len * p + 99) / 100;
    for (int i = 0; i < a.size; ++i) {
      int flag = 1;
      for (int j = 0; j < Size; ++j) {
        if (tmp[j].color == a.a[i].color) {
          tmp[j].size += a.a[i].size;
          flag = 0;
          break;
        }
      }
      if (flag) tmp[Size] = a.a[i], ++Size;
    }
    for (int i = 0; i < b.size; ++i) {
      int flag = 1;
      for (int j = 0; j < Size; ++j) {
        if (tmp[j].color == b.a[i].color) {
          tmp[j].size += b.a[i].size;
          flag = 0;
          break;
        }
      }
      if (flag) tmp[Size] = b.a[i], ++Size;
    }
    for (int i = 0; i < Size; ++i) {
      bool flag = false;
      for (int j = 0; j < res.size; ++j) {
        if (tmp[i].color == res.a[j].color) {
          res.a[j].color += tmp[i].color;
          flag = true;
          break;
        }
      }
      if (flag) continue;
      if (res.size < limit) {
        res.a[res.size] = tmp[i];
        ++res.size;
        continue;
        ;
      }
      int Min_pos = 0;
      for (int j = 1; j < res.size; ++j)
        if (res.a[j].size < res.a[Min_pos].size) Min_pos = j;
      if (res.a[Min_pos].size <= tmp[i].size) std::swap(res.a[Min_pos], tmp[i]);
      for (int j = 0; j < res.size; ++j) res.a[j].size -= tmp[i].size;
    }
    return res;
  }
};
struct node {
  Node a;
  int l, r, tag_color, tag_flag;
  node *ls, *rs;
  void up() { a = ls->a + rs->a; }
  void Modify(int color) {
    a.init(color, a.len), tag_color = color, tag_flag = 1;
  }
  void down() {
    if (tag_flag) {
      ls->Modify(tag_color);
      rs->Modify(tag_color);
      tag_flag = 0;
    }
  }
  node(int l, int r) : l(l), r(r), tag_color(0), tag_flag(0) {
    if (l == r) {
      a.len = 1;
      a.init(read(), 1);
      return;
    }
    ls = new node(l, ((l + r) >> 1)), rs = new node(((l + r) >> 1) + 1, r);
    up();
  }
  void Modify(int L, int R, int color) {
    if (L <= l && r <= R) return Modify(color);
    if (tag_flag) down();
    if (((l + r) >> 1) >= L) ls->Modify(L, R, color);
    if (((l + r) >> 1) < R) rs->Modify(L, R, color);
    up();
  }
  Node ask(int L, int R) {
    if (L <= l && r <= R) return a;
    if (tag_flag) down();
    if (((l + r) >> 1) >= R) return ls->ask(L, R);
    if (((l + r) >> 1) < L) return rs->ask(L, R);
    return ls->ask(L, R) + rs->ask(L, R);
  }
} * root;
int main() {
  int n = read(), m = read();
  p = read();
  limit = 100 / p;
  root = new node(1, n);
  for (; m-- > 0;) {
    int opt = read(), l = read(), r = read(), color;
    if (opt == 1)
      color = read(), root->Modify(l, r, color);
    else {
      Node ans = root->ask(l, r);
      printf("%d ", ans.size);
      for (int i = 0; i < ans.size; ++i) {
        printf("%d%c", ans.a[i].color, (i == (ans.size - 1)) ? '\n' : ' ');
      }
    }
  }
}