#include "art.h"
#include <bits/stdc++.h>
using namespace std;
/*
vector <int> ans = {3,2,5,4,1,6,7,8,9,12,11,10};
vector <int> pos = {5,2,1,4,3,6,7,8,9,12,11,10};
int cnt=0;
void answer(vector <int> v){
cout<<cnt<<"\n";
if (v==ans){cout<<"YES";}
else{for (auto x : v){cout<<x<<' ';}}
}
int publish(vector <int> v){
cnt++;
int n=v.size();
int sm=0;
for (int i=n-1; i>=1; i--){
for (int j=i-1; j>=0; j--){
if (pos[v[j]-1]>pos[v[i]-1]){sm++;}
}
}
return sm;
}
*/
vector<int>switchtwo(int a,int b,vector<int>c)
{
if (a == b) return c;
int i1,i2;
int n = c.size();
for (int i = 0; i < n; i++)
{
if (c[i] == a) i1 = i;
if (c[i] == b) i2 = i;
}
swap(c[i1],c[i2]);
return c;
}
void solve(int N)
{
vector<int>c(N);
for (int i = 1; i <= N; i++) c[i - 1] = i;
int sm = publish(c);
for (int i = 1; i <= N; i++)
{
for (int j = 1; j <= N; j++)
{
vector<int>newc = switchtwo(i,j,c);
int csm = publish(newc);
if (sm > csm)
{
c = newc;
sm = csm;
}
}
}
answer(c);
return;
}