#include <bits/stdc++.h>
const int inf = 0x3f3f3f3f, Inf = 0x7fffffff;
const long long INF = 0x7fffffffffffffff;
const double eps = 1e-10;
unsigned int seed = 19260817;
const unsigned int _RAND_MAX_ = 4294967295u;
__inline__ __attribute__((always_inline)) unsigned int Rand() {
  return seed = seed * 998244353u + 1000000007u;
}
template <typename _Tp>
_Tp gcd(const _Tp &a, const _Tp &b) {
  return (!b) ? a : gcd(b, a % b);
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) _Tp abs(const _Tp &a) {
  return a >= 0 ? a : -a;
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) _Tp max(const _Tp &a, const _Tp &b) {
  return a < b ? b : a;
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) _Tp min(const _Tp &a, const _Tp &b) {
  return a < b ? a : b;
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) void chmax(_Tp &a, const _Tp &b) {
  (a < b) && (a = b);
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) void chmin(_Tp &a, const _Tp &b) {
  (b < a) && (a = b);
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) bool _cmp(const _Tp &a,
                                                    const _Tp &b) {
  return abs(a - b) <= eps;
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) void read(_Tp &x) {
  register char ch(getchar());
  bool f(false);
  while (ch < 48 || ch > 57) f |= ch == 45, ch = getchar();
  x = ch & 15, ch = getchar();
  while (ch >= 48 && ch <= 57)
    x = (((x << 2) + x) << 1) + (ch & 15), ch = getchar();
  if (f) x = -x;
}
template <typename _Tp, typename... Args>
__inline__ __attribute__((always_inline)) void read(_Tp &t, Args &...args) {
  read(t);
  read(args...);
}
__inline__ __attribute__((always_inline)) int read_str(char *s) {
  register char ch(getchar());
  while (ch == ' ' || ch == '\r' || ch == '\n') ch = getchar();
  register char *tar = s;
  *tar = ch, ch = getchar();
  while (ch != ' ' && ch != '\r' && ch != '\n' && ch != EOF)
    *(++tar) = ch, ch = getchar();
  return tar - s + 1;
}
const int N = 150005;
int p, tot;
struct node {
  int val, cnt;
};
std::vector<node> tmp;
int a[N];
__inline__ __attribute__((always_inline)) std::vector<node> merge(
    std::vector<node> ans, const std::vector<node> &b) {
  for (auto it : b) {
    bool flag = false;
    for (auto &itt : ans) {
      if (itt.val == it.val) {
        flag = true;
        itt.cnt += it.cnt;
        break;
      }
    }
    if (!flag) {
      ans.push_back(it);
    }
  }
  while ((int)ans.size() > tot) {
    int minn = inf;
    for (int i = 0; i <= tot; ++i) {
      chmin(minn, ans[i].cnt);
    }
    for (int i = 0; i <= tot; ++i) {
      ans[i].cnt -= minn;
    }
    tmp.clear();
    for (auto it : ans) {
      if (it.cnt) {
        tmp.push_back(it);
      }
    }
    ans = tmp;
  }
  return ans;
}
struct seg_tr {
  struct Node {
    int ls, rs;
    std::vector<node> val;
    int tag;
  } f[N << 1];
  int node_cnt;
  __inline__ __attribute__((always_inline)) void PushUp(int x) {
    f[x].val = merge(f[f[x].ls].val, f[f[x].rs].val);
  }
  int build(int l, int r) {
    int cur = ++node_cnt;
    if (l == r) {
      f[cur].val.push_back((node){a[l], 1});
      return cur;
    }
    int mid = (l + r) >> 1;
    f[cur].ls = build(l, mid);
    f[cur].rs = build(mid + 1, r);
    PushUp(cur);
    return cur;
  }
  __inline__ __attribute__((always_inline)) void cover(int cur, int l, int r,
                                                       int C) {
    f[cur].val.clear();
    f[cur].val.push_back((node){C, r - l + 1});
    f[cur].tag = C;
  }
  __inline__ __attribute__((always_inline)) void PushDown(int cur, int l,
                                                          int r) {
    if (f[cur].tag) {
      int mid = (l + r) >> 1;
      cover(f[cur].ls, l, mid, f[cur].tag);
      cover(f[cur].rs, mid + 1, r, f[cur].tag);
      f[cur].tag = 0;
    }
  }
  void Update(int L, int R, int l, int r, int cur, int C) {
    if (L <= l && r <= R) {
      cover(cur, l, r, C);
      return;
    }
    PushDown(cur, l, r);
    int mid = (l + r) >> 1;
    if (L <= mid) Update(L, R, l, mid, f[cur].ls, C);
    if (R > mid) Update(L, R, mid + 1, r, f[cur].rs, C);
    PushUp(cur);
  }
  std::vector<node> Query(int L, int R, int l, int r, int cur) {
    if (L <= l && r <= R) {
      return f[cur].val;
    }
    PushDown(cur, l, r);
    int mid = (l + r) >> 1;
    if (L <= mid && R > mid) {
      return merge(Query(L, R, l, mid, f[cur].ls),
                   Query(L, R, mid + 1, r, f[cur].rs));
    }
    if (L <= mid) {
      return Query(L, R, l, mid, f[cur].ls);
    }
    return Query(L, R, mid + 1, r, f[cur].rs);
  }
} tr;
int main() {
  int n, _, p;
  read(n, _, p);
  tot = 100 / p;
  for (int i = 1; i <= n; ++i) read(a[i]);
  tr.build(1, n);
  int opt, l, r, v;
  std::vector<node> qwq;
  while (_--) {
    read(opt);
    if (opt == 1) {
      read(l, r, v);
      tr.Update(l, r, 1, n, 1, v);
    } else {
      read(l, r);
      qwq = tr.Query(l, r, 1, n, 1);
      printf("%d ", (int)qwq.size());
      for (auto it : qwq) printf("%d ", it.val);
      printf("\n");
    }
  }
  return 0;
}
