#ifndef ONLINE_JUDGE #define _GLIBCXX_DEBUG #endif #include #include using namespace std; using ll=long long; using ld=long double; using st=string; using P=pair; typedef atcoder::modint mint; ll inf=9e18; template auto vec(const ll (&sizes)[s], const T& init = T()){ if constexpr(i < s) return vector(sizes[i], vec(sizes, init)); else return init; } int main(){ ll n; cin>>n; auto a=vec({n},0); auto b=vec({n},0); for(ll i=0;i>a[i]; a[i]--; } for(ll i=0;i>b[i]; b[i]--; } auto c=vec({n},0); for(ll i=0;ic[a[j+1]]){ swap(a[j],a[j+1]); j++; } } for(auto i:a){ cout<