#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef long double ld;

const int inf = 1e9;
const ll inf64 = 1e18;

int main() {

#ifdef DEBUG
    freopen("input.txt", "r", stdin);
#endif

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

    int n;
    cin >> n;
    vector<int> a(n + 1), b(n + 1), p(n + 1), f(n + 1), pp;

    for (int i = 1; i <= n; i++)
        cin >> a[i];
    for (int i = 1; i <= n; i++)
        cin >> b[i];
    for (int i = 1; i <= n; i++)
        cin >> p[i];

    pp = p;

    set<pii> q;

    for (int i = 1; i <= n; i++)
        f[p[i]] = i;

    for (int i = 1; i <= n; i++) {
        if (i == p[i])
            continue;
        q.insert({b[i], i});
        if (a[i] <= b[p[i]]) {
            cout << "-1\n";
            return 0;
        }
    }

    vector<pii> res;

    while (!q.empty()) {
        int i = (--q.end())->second;
        q.erase(--q.end());
        if (p[i] == i)
            continue;
        int j = f[i], k = p[i];
        res.emplace_back(i, j);

        p[i] = i;
        f[i] = i;

        p[j] = k;
        f[k] = j;
    }

    p = pp;

    cout << (int) res.size() << "\n";
    for (auto [i, j] : res) {
        assert(a[i] > b[p[i]]);
        assert(a[j] > b[p[j]]);
        cout << i << " " << j << "\n";
        swap(p[i], p[j]);
    }

    for (int i = 1; i <= n; i++)
        assert(p[i] == i);

    return 0;
}

#include <bits/stdc++.h>
// #include <atcoder/all>
// using namespace atcoder;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) x.begin(),x.end() 
#define SZ(x) ((int)(x).size())
#define PB push_back
#define MP make_pair
#define V vector
#define P pair<int,int>
#define F first
#define S second
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
using ll = long long;
using ld = long double;
using namespace std;
const int INF =1001001001;
const int MAX = 2e6+1;
int main() {
    int a,b;cin>>a>>b;
    int w;cin>>w;
    w*=1000;
    int ans1=0,ans2=INF;
    rep(i,1,1e+7){
        double x = (double)w/i;
        if(a<=x&&x<=b){
            chmax(ans1,i);
            chmin(ans2,i);
        }
    }
    if(ans2==INF){
        cout<<"UNSATISFIABLE"<<endl;
        return 0;
    }
    cout<<ans2<<" "<<ans1<<endl;
}