#include <string>
#include <iostream>
#include <stack>
#include <queue> // priority_queue も入ってる
#include <set>   // 要素数は size() で取得 multisetもある
#include <map>
#include <array> // sizeはコンパイル時定数で固定
#include <vector>
#include <numeric>   // accumulate, gcd
#include <algorithm> // count_ifに必要
#include <iomanip>   // cout << setprecision(15) << x で小数の出力精度を指定
#include <tuple>
#include <utility> //pair
#include <cmath>
#include <random>

using namespace std;
using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)

int main()
{
    ll n;
    cin >> n;
    vector<ll> a(n);
    vector<ll> b(n);
    vector<ll> p(n);
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> b[i];
    rep(i, n) cin >> p[i];
    rep(i, n) p[i]--;
    vector<ll> q(n);
    rep(i, n)
    {
        q[p[i]] = i;
    }
    vector<pair<ll, ll>> answer;
    vector<pair<ll, ll>> people;
    rep(i, n) people.push_back(pair<ll, ll>{a[i], i});
    sort(people.begin(), people.end());
    rep(i, n)
    {
        if (people[i].second != p[people[i].second])
        {
            // 注目してる人の番号(Aさん)
            ll person = people[i].second;
            // Aさんが持ってる荷物の番号
            ll nimotsu = p[person];
            // 「Aさんが持つべき荷物」を持ってる人(Bさん)の番号
            ll aite = q[person];
            // Bさんが持っている荷物の番号
            ll nimotsuB = p[aite];
            if (a[person] <= b[nimotsu])
            {
                cout << -1 << endl;
                return 0;
            }
            // AさんとBさんの荷物を入れ替える

            answer.push_back(pair<ll, ll>{person, aite});
            ll temp = p[person]; // ==nimotsu
            p[person] = p[aite]; // ==person
            p[aite] = temp;      // ==nimotsu
            ll temp2 = q[nimotsu];
            q[nimotsu] = q[nimotsuB];
            q[nimotsuB] = temp2;
        }
    }

    cout << answer.size() << endl;
    for (pair<ll, ll> z : answer)
    {
        cout << z.first + 1 << ' ' << z.second + 1 << endl;
    }
    return 0;
}

//#include <atcoder/maxflow.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
 

#include <iostream>
#include <map>
#include <list>
#include <set>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <queue>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <iterator>
#include <random>
#include <chrono>
#include <complex>
#include <bitset>
#include <fstream>
 
 
#define forr(i,start,count) for (int i = (start); i < (start)+(count); ++i)
#define set_map_includes(set, elt) (set.find((elt)) != set.end())
#define readint(i) int i; cin >> i
#define readll(i) ll i; cin >> i
#define readdouble(i) double i; cin >> i
#define readstring(s) string s; cin >> s

typedef long long ll;

 
//using namespace __gnu_pbds;
//using namespace atcoder;
using namespace std;

const ll modd = (1000LL * 1000LL * 1000LL + 7LL);
//const ll modd = 998244353;

ll binary_search(function<bool(ll)> func, ll start, ll end) {
    /*      func:int ->bool
            returns smallest int x where func(x) evaluates to true, searches in [start,end), it is assumed the values are false, .. , false, true ...
             */
    if (end <= start) {   return end;  }   // has to be here, otherwise func(end-1) in next line could be a problem
    if (!func(end-1)) {  return end;  }
    while (end-start>1) {
        ll mid = (start+end)/2;
        if (func(mid)) {  end = mid;  } else { start = mid;   }
    }
    if (func(start)) {  return start;  } else {  return end;   }
};


int main(int argc, char *argv[])   {

    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    uniform_int_distribution<int> rand_gen(0, modd);   // rand_gen(rng) gets the rand no

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    cout.precision(12);

//    readint(test_cases);
    int test_cases = 1;
    forr(t, 1, test_cases) {
        readll(a); readll(b); readll(c); readll(d);
        if (b>=c*d) {
            cout << -1 << endl;
            continue;
        }

        cout << binary_search([a,b,c,d](ll x) {
            return a+b*x<=d*c*x;
        }, 0, 10+a/(d*c-b)) << endl;

    }

    return 0;
}
