#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<n;++i)
#define repn(i,n) for(int i=1;i<=n;++i)
#define LL long long
#define pii pair <int,int>
#define fi first
#define se second
#define pb push_back
#define mpr make_pair

using namespace std;

const LL MOD=1e9+7;

int n,a[200010],b[200010],p[200010],pos[200010];
vector <int> v;
vector <pii> ans;

bool cmp(int x,int y)
{
  return b[x]>b[y];
}

int main()
{
  cin>>n;
  rep(i,n) scanf("%d",&a[i]);
  rep(i,n) scanf("%d",&b[i]);
  rep(i,n)
  {
    scanf("%d",&p[i]),--p[i];
    if(p[i]!=i&&b[p[i]]>=a[i])
    {
      puts("-1");
      return 0;
    }
    pos[p[i]]=i;
    v.pb(i);
  }
  sort(v.begin(),v.end(),cmp);
  //rep(i,v.size()) cout<<v[i]<<'p'<<endl;
  rep(i,n)
  {
    if(pos[v[i]]==v[i]) continue;
    ans.pb(mpr(pos[v[i]],v[i]));
    int aa=pos[v[i]],bb=v[i],cc=v[i],dd=p[v[i]];
    p[cc]=bb;
    p[aa]=dd;
    pos[bb]=cc;
    pos[dd]=aa;
  }
  cout<<ans.size()<<endl;
  rep(i,ans.size()) printf("%d %d\n",ans[i].fi+1,ans[i].se+1);
	return 0;
}
//Jo Hack kiya Wo Madharchod

#include"bits/stdc++.h"
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define ll long long int
#define inf 1e18+5
#define sr string
#define M 1000000007 //998244353//
#define start int t;cin>>t;while(t--)
#define db(x) cout<<#x<<"="<<x<<"\n"
#define db2(a,b)cout<<#a<<": "<<a<<" , "<<#b<<": "<<b<< endl;
#define db3(a,b,c)cout<<#a<<": "<<a<<" , "<<#b<<": "<<b<<" , "<<#c<<": "<<c<<endl;
#define forr(i, n) for (int i = 0; i < n; i++)
#define fr(i, n) for (int i = 1; i <= n; i++)
#define rep(i,j,k) for(int i = j; i < k; i++)
#define rp(i,j,k) for(int i = j; i <=k; i++)
#define nn "\n"
#define en "\n"
#define vvi vector<vector<ll>>
#define vi vector<int>
#define si set<ll>
#define mlsi multiset<ll>
#define vc vector<char>
#define vli vector<long long int>
#define vpii vector<pair<ll,ll>>
#define pii pair<ll,ll>
#define mii map<ll,ll>
#define msi map<string,int>
#define mci map<char,int>
#define umii unordered_map<ll,ll> 
#define umsi unordered_map<string,int>
#define umci unordered_map<char,int>
#define mkp make_pair
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define sortv(x) sort(x.begin(),x.end())
#define sorta(x,n) sort(x,x+n)
#define sorted(x) is_sorted(x.begin(),x.end())
#define print_all(x) for(auto t:x) cout<<t<<" ";cout<<en;
#define mxe(x) *max_element(all(x))
#define mne(x) *min_element(all(x))
#define ad(x) accumulate(all(x),0)
#define ub upper_bound
#define lb lower_bound
#define go(x) for(auto &[u,v]:x)
#define gov(v) for(auto &x:v)
#define in(x) cin>>x
#define in2(x,y) cin>>x>>y
#define in3(x,y,z) cin>>x>>y>>z
#define in4(x,y,z,v) cin>>x>>y>>z>>v
#define oo(x) cout<<x<<en
#define oo2(x,y) cout<<x<<" "<<y<<en
#define oo3(x,y,z) cout<<x<<" "<<y<<" "<<z<<en
#define ood(n,x) cout<<fixed<<setprecision(n)<<x<<"\n"
#define sz(x) x.size()
#define ff first
#define ss second
#define ooy cout<<"Yes\n"
#define oon cout<<"No\n"
#define ooyy cout<<"YES\n"
#define oonn cout<<"NO\n" 
#define rr return
#define cc continue

using namespace std;

template<class T> bool ckmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<class T> bool ckmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

void read(vli &a,int n){
    a.resize(n);
    forr(i,n) cin>>a[i];
}

bool fine=0;
vli a;
ll n,m,k,x,p,q;


void solve(){

    in(n);
    if(n&1){
        cout<<"Black";
    }
    else cout<<"White";


}
int main(){
   #ifndef ONLINE_JUDGE 
    freopen("input1.txt", "r", stdin); 
    freopen("error.txt", "w", stderr); 
    freopen("output1.txt", "w", stdout); 
    #endif
    fast;
    if(fine){
        start{
            solve();
        }
   }
   else solve();
    return 0;
}