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>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
using namespace std;
template <class T>
bool umin(T &x, T y) {
  return y < x ? x = y, 1 : 0;
}
template <class T>
bool umax(T &x, T y) {
  return y > x ? x = y, 1 : 0;
}
template <typename T>
ostream &operator<<(ostream &out, vector<T> a) {
  for (int i = 0; i < a.size(); ++i) out << a[i] << " ";
  out << "\n";
  return out;
}
template <typename T>
istream &operator>>(istream &in, std::vector<T> &a) {
  for (int i = 0; i < a.size(); ++i) in >> a[i];
  return in;
}
namespace IO {
const int MAX = 1 << 20;
char buf[MAX], Buf[MAX], *p1 = buf, *p2 = buf, *P1 = Buf, *P2 = Buf + MAX;
inline char gc() {
  if (p1 != p2) return *p1++;
  p1 = buf;
  p2 = p1 + fread(buf, 1, MAX, stdin);
  return (p1 == p2) ? (EOF) : (*p1++);
}
inline void pc(const char c) {
  if (P1 != P2)
    *P1++ = c;
  else {
    fwrite(Buf, P1 - Buf, 1, stdout);
    P1 = Buf;
    *P1++ = c;
  }
}
void readstr(char *s, bool fg = 0) {
  char ch = gc();
  while (ch == '\n' || ch == '\r' || (!fg && ch == ' ')) ch = gc();
  while (ch != '\n' && ch != '\r' && (fg || ch != ' ')) *s++ = ch, ch = gc();
  *s = '\0';
}
void writestr(const char *s, char ch = '\0') {
  for (const char *p = s; *p; ++p) pc(*p);
  (ch != '\0') && (pc(ch), 1);
}
template <typename _Tp>
void read(_Tp &x) {
  x = 0;
  char ch = gc();
  int f = 0;
  while (ch < '0' || ch > '9') {
    (ch == '-') && (f ^= 1);
    ch = gc();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + (_Tp)(ch ^ 48), ch = gc();
  f && (x = -x);
}
template <typename Tp, typename... Args>
void read(Tp &t, Args &...args) {
  read(t);
  read(args...);
}
template <typename Tp>
void write(Tp x, char ch = '\0') {
  static int buf[100], d;
  if (x == 0)
    pc('0');
  else {
    if (x < 0) pc('-'), x = -x;
    for (d = 0; x; x /= 10) buf[++d] = x % 10 + 48;
    while (d) pc((char)buf[d--]);
  }
  if (ch != '\0') pc(ch);
}
void flush() {
  fwrite(Buf, P1 - Buf, 1, stdout);
  P1 = Buf;
}
struct _flusher {
  ~_flusher() { flush(); }
} flusher;
}  // namespace IO
using IO::read;
using IO::readstr;
using IO::write;
using IO::writestr;
const int N = 150005;
int n, m, p, a[N], maxnum;
struct segtree {
  int tag[N * 4];
  vector<pair<int, int> > mos[N * 4];
  inline void Pushdown(int p, int l, int r) {
    if (tag[p]) {
      tag[(p << 1)] = tag[(p << 1 | 1)] = tag[p];
      mos[(p << 1)].resize(1);
      mos[(p << 1)][0] = pair<int, int>(tag[p], ((l + r) >> 1) - l + 1);
      mos[(p << 1 | 1)].resize(1);
      mos[(p << 1 | 1)][0] = pair<int, int>(tag[p], r - ((l + r) >> 1));
      tag[p] = 0;
    }
  }
  inline vector<pair<int, int> > Merge(vector<pair<int, int> > A,
                                       vector<pair<int, int> > B) {
    vector<pair<int, int> > res;
    A.swap(res);
    for (int i = 0; i < B.size(); ++i) {
      pair<int, int> cur = B[i];
      int ok = 0;
      for (int j = 0; j < res.size(); ++j) {
        if (res[j].first == cur.first) {
          res[j].second += cur.second;
          ok = 1;
          break;
        }
      }
      if (!ok) {
        if (res.size() < maxnum)
          res.push_back(cur);
        else {
          pair<int, int> mi = cur;
          int pos = -1;
          for (int j = 0; j < res.size(); ++j) {
            if (res[j].second < mi.second) mi = res[j], pos = j;
          }
          if (pos >= 0) res[pos] = cur;
          for (int j = 0; j < res.size(); ++j) res[j].second -= mi.second;
        }
      }
    }
    return res;
  }
  inline void Pushup(int p, int l, int r) {
    Merge(mos[(p << 1)], mos[(p << 1 | 1)]).swap(mos[p]);
  }
  inline void Build(int p, int l, int r) {
    if (l > r) return;
    tag[p] = 0;
    if (l == r) {
      mos[p].push_back(pair<int, int>(a[l], 1));
      return;
    }
    Build((p << 1), l, ((l + r) >> 1));
    Build((p << 1 | 1), ((l + r) >> 1) + 1, r);
    Pushup(p, l, r);
  }
  inline void Modify(int p, int l, int r, int s, int e, int val) {
    if (r < s || l > e) return;
    if (s <= l && r <= e) {
      tag[p] = val;
      mos[p].resize(1);
      mos[p][0] = pair<int, int>(val, r - l + 1);
      return;
    }
    Pushdown(p, l, r);
    Modify((p << 1), l, ((l + r) >> 1), s, e, val);
    Modify((p << 1 | 1), ((l + r) >> 1) + 1, r, s, e, val);
    Pushup(p, l, r);
  }
  vector<pair<int, int> > ans;
  inline void Query(int p, int l, int r, int s, int e) {
    if (r < s || l > e) return;
    if (s <= l && r <= e) {
      Merge(ans, mos[p]).swap(ans);
      return;
    }
    Pushdown(p, l, r);
    Query((p << 1), l, ((l + r) >> 1), s, e);
    Query((p << 1 | 1), ((l + r) >> 1) + 1, r, s, e);
    Pushup(p, l, r);
  }
} T;
signed main() {
  read(n);
  read(m);
  read(p);
  for (int i = 1; i <= n; ++i) read(a[i]);
  maxnum = 100 / p;
  T.Build(1, 1, n);
  for (int cs = 1, op, l, r, id; cs <= m; ++cs) {
    read(op);
    read(l);
    read(r);
    if (op == 1) read(id);
    if (op == 1) {
      T.Modify(1, 1, n, l, r, id);
    } else {
      T.ans.resize(0);
      T.Query(1, 1, n, l, r);
      write((int)T.ans.size(), ' ');
      for (int i = 0; i < T.ans.size(); ++i) write(T.ans[i].first, ' ');
      writestr("\n");
    }
  }
  return 0;
}