#include /*門松コンはいいぞ*/ /*絶対門松全問解こうな*/ using namespace std; typedef pair P; vector

mysort(vector A,int m){ vector

res; int N=A.size(); for(int i=0;iA[j]){ bottom=A[j]; id=j; } if(id!=i)res.push_back(P(i,id)); swap(A[i],A[id]); } return res; string s;cin>>s; } void print(vector

& v){ cout<>N; vector A(N); for(auto &it:A)cin>>it; auto p=mysort(A,1); auto q=mysort(A,-1); if(p.size()