U500140 To Kiss Autumn

题目背景

[Chinese statement](https://www.luogu.com.cn/problem/P11244). **You must submit your code at the Chinese version of the statement.** Just as the autumn rain kissed the earth, white clouds rolled up a scroll of red, orange, yellow, green, blue, indigo, and purple. The wavelength goes into a free falling movement within the visible light range, giving the evaporated water a progressive melody. The impression of blurred gradient colors is often quickly carried away by sunny days, while the abnormal absolute difference is recalled by many in the mind. In this case, is orderliness, really the best?

题目描述

Clein has $m$ sequences of integers $a_1\dots a_m$, each of length $n$. Clein wants to sort his sequences in ascending order. So Clein has $q$ operations, each of which belongs to a sort or a query: - Either, given $x, y\ (x \neq y)$. Clein wants to concatenate $a_x$ and $a_y$ into a sequence $b$ of length $2n$, sort $b$ in ascending order, and then take $b_1\dots b_n$ as the new $a_x$, and $b_{n+1}\dots b_{2n}$ as the new $a_y$; - Or, given $i, j$. Clein wants to ask you the value of $a_{i,j}$ after the previous operations.

输入格式

输出格式

说明/提示

**Please try to use a faster method for input and output; the actual input file for the last subtask is exceeding 50MB, and the last but one exceeding 18MB.** Below is a template that you can feel free to use in your own C++ code. ```cpp namespace FastIO { char buf[1