#include using namespace std; const int N=1e5+5; bitset bs,bst[N],ansb; vector v[N]; int n,a[N],b[N]; int main() { // freopen("stamp.in","r",stdin); // freopen("stamp.out","w",stdout); cin>>n; for(int i=1; i<=n; i++) cin>>a[i],v[a[i]].push_back(i); for(int i=1; i<=n; i++) cin>>b[i]; for(int i=1; i<=n; i++) { if(!v[i].size()) continue; for(int j=0; j