Yuno And Claris

아직 제출이 없습니다시간 제한3초메모리 제한512 MB

문제

Yuno failed in a contest, so she was forced to wear a JK dress. Claris won the contest, so she bought some JK dresses for Yuno to wear. Each dress has a price. Because Claris has lots of money, she bought nn dresses and put them in an array a_1,a_2,,a_na\_1, a\_2, \ldots, a\_n.

Because Yuno loves data structures, she invented two kinds of operations:

  • "1 l r x y": For all the dresses in a_l,a_l+1,,a_ra\_l, a\_{l+1}, \ldots, a\_r, if the price of a dress is xx, change its price to yy.
  • "2 l r k": Yuno wants to wear the kk-th cheapest dress from a_l,a_l+1,,a_ra\_l, a\_{l+1}, \ldots, a\_r, so tell her the price of this dress.

입력

The first line of the input contains two integers nn and mm: the number of dresses and the number of operations (1n,m1051 \leq n, m \leq 10^5). The second line contains nn integers a_1,a_2,,a_na\_1, a\_2, \ldots, a\_n: the prices of the dresses (1a_in1 \leq a\_i \leq n). Each of the following mm lines describes an operation. If it is a modification, then the line is formatted as "1 l r x y", where 1lrn1 \leq l \leq r \leq n and 1x,yn1 \leq x, y \leq n. If it is a query, then the line is formatted as "2 l r k", where 1lrn1 \leq l \leq r \leq n and 1krl+11 \leq k \leq r - l + 1.

출력

For each query, print a single line with a single integer: the answer to the query.