#ifndef ONLINE_JUDGE #include "header.hpp" #else #include #include #include using cpp_int=boost::multiprecision::cpp_int; #include templateusing cpp_float=boost::multiprecision::number>; templateusing cpp_double=boost::multiprecision::number>; #endif using namespace std; using ll=long long; inline void yn(bool x){if(x){cout<<"Yes"< inline void erase_duplicate(vector& A){sort(A.begin(),A.end());A.erase(unique(A.begin(),A.end()),A.end());} inline ll powll(ll x,ll n){ll r=1;while(n>0){if(n&1){r*=x;};x*=x;n>>=1;};return r;} struct S{ ll val; ll index; }; S op(S a, S b){ if(a.val>b.val){ return b; }else{ return a; } } S e(){ return S{(ll)1e9,-1}; } int main(){ ll N,Q; cin>>N>>Q; vector A(N); for(ll i=0;i>A[i].val; A[i].index=i; } atcoder::segtree seg(A); for(ll i=0;i>t>>l>>r; l--; r--; if(t==1){ S L=seg.get(l); S R=seg.get(r); seg.set(l,S{R.val,l}); seg.set(r,S{L.val,r}); }else{ cout<