#include using namespace std; using ll = long long; using ld = long double; using P = pair; using vl = vector; using Map = map; using Tup = tuple; using vvl = vector>; #define all(v) v.begin(), v.end() #define prt(v) cout<<(v)<<"\n"; #define fl cout<(v) #define se(v) get<1>(v) #define th(v) get<2>(v) #define endl "\n" template bool chmax(T &a, const T &b){if (a bool chmin(T &a, const T &b){if (a>b){a=b;return 1;}return 0;} const ll INF=1LL<<60; const ll MOD=1000000007; const ll MOD2=998244353; const ld pi=3.141592653589793238; signed main(void){ cin.tie(0);cout.tie(0);ios::sync_with_stdio(false); ll N; cin >> N; vector S(N+1,0); vector T(N+1,0); vector U(N+1,0); for(ll i=1;i>S[i]; for(ll i=1;i>T[i]; for(ll i=1;i>U[i]; vector> ans(N+1, vector(N+1, -1)); //U[i]について考察 for(ll i=1;i