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;
const int inf = (int)1e9;
const long long INF = (long long)5e18;
const int MOD = 998244353;
int _abs(int x) { return x < 0 ? -x : x; }
int add(int x, int y) {
  x += y;
  return x >= MOD ? x - MOD : x;
}
int sub(int x, int y) {
  x -= y;
  return x < 0 ? x + MOD : x;
}
void Add(int &x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
void Sub(int &x, int y) {
  x -= y;
  if (x < 0) x += MOD;
}
void Mul(int &x, int y) { x = (long long)(x) * (y) % MOD; }
int qpow(int x, int y) {
  int ret = 1;
  while (y) {
    if (y & 1) ret = (long long)(ret) * (x) % MOD;
    x = (long long)(x) * (x) % MOD;
    y >>= 1;
  }
  return ret;
}
void checkmin(int &x, int y) {
  if (x > y) x = y;
}
void checkmax(int &x, int y) {
  if (x < y) x = y;
}
void checkmin(long long &x, long long y) {
  if (x > y) x = y;
}
void checkmax(long long &x, long long y) {
  if (x < y) x = y;
}
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  return x * f;
}
const int N = 150005;
int n, len, a[N];
struct node {
  pair<int, int> a[6];
};
node operator+(node A, node B) {
  node C;
  pair<int, int> t[11];
  int top = 0;
  for (int i = 1; i <= len; i++) {
    int flag = 0;
    for (int j = 1; j <= top; j++)
      if (t[j].second == A.a[i].second) t[j].first += A.a[i].first, flag = 1;
    if (!flag) t[++top] = A.a[i];
    flag = 0;
    for (int j = 1; j <= top; j++)
      if (t[j].second == B.a[i].second) t[j].first += B.a[i].first, flag = 1;
    if (!flag) t[++top] = B.a[i];
  }
  sort(t + 1, t + top + 1);
  reverse(t + 1, t + top + 1);
  for (int i = len + 1; i <= top; i++) {
    for (int j = len; j >= 1; j--) {
      if (t[j].first < t[i].first) {
        for (int k = j - 1; k >= 1; k--) t[k].first -= t[j].first;
        t[j] = make_pair(t[i].first - t[j].first, t[i].second);
        break;
      } else
        t[j].first -= t[i].first;
    }
  }
  for (int i = 1; i <= len; i++) C.a[i] = t[i];
  return C;
}
struct Segment_Tree {
  node sum[N << 2];
  int tag[N << 2];
  void pushup(int x) { sum[x] = sum[x << 1] + sum[x << 1 | 1]; }
  void build(int x, int l, int r) {
    if (l == r) {
      for (int i = 1; i <= len; i++) sum[x].a[i] = make_pair(0, 0);
      sum[x].a[1] = make_pair(1, a[l]);
      return;
    }
    int mid = (l + r) >> 1;
    build(x << 1, l, mid);
    build(x << 1 | 1, mid + 1, r);
    pushup(x);
  }
  void pushtag(int x, int l, int r, int val) {
    for (int i = 1; i <= len; i++) sum[x].a[i] = make_pair(0, 0);
    tag[x] = val;
    sum[x].a[1] = make_pair(r - l + 1, val);
  }
  void pushdown(int x, int l, int mid, int r) {
    if (tag[x]) {
      pushtag(x << 1, l, mid, tag[x]);
      pushtag(x << 1 | 1, mid + 1, r, tag[x]);
      tag[x] = 0;
    }
  }
  void update(int x, int l, int r, int L, int R, int val) {
    if (L <= l && r <= R) {
      pushtag(x, l, r, val);
      return;
    }
    int mid = (l + r) >> 1;
    pushdown(x, l, mid, r);
    if (mid >= L) update(x << 1, l, mid, L, R, val);
    if (mid < R) update(x << 1 | 1, mid + 1, r, L, R, val);
    pushup(x);
  }
  node query(int x, int l, int r, int L, int R) {
    if (L <= l && r <= R) return sum[x];
    node ret;
    for (int i = 1; i <= len; i++) ret.a[i] = make_pair(0, 0);
    int mid = (l + r) >> 1;
    pushdown(x, l, mid, r);
    if (mid >= L) ret = ret + query(x << 1, l, mid, L, R);
    if (mid < R) ret = ret + query(x << 1 | 1, mid + 1, r, L, R);
    return ret;
  }
} tree;
int main() {
  n = read();
  int m = read(), p = read();
  len = 100 / p;
  for (int i = 1; i <= n; i++) a[i] = read();
  tree.build(1, 1, n);
  while (m--) {
    int typ = read();
    if (typ == 1) {
      int l = read(), r = read(), id = read();
      tree.update(1, 1, n, l, r, id);
    } else {
      int l = read(), r = read();
      node ret = tree.query(1, 1, n, l, r);
      printf("%d ", len);
      for (int i = 1; i <= len; i++) printf("%d ", ret.a[i].second);
      puts("");
    }
  }
  return 0;
}