#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
using namespace std;

int n, m, xa, xb, ya, yb;
char t;



int main () {
scanf ("%d %d", &n, &m);


    for (int i=1; i<=n; i++) {
cin>>t;
    }
        for (int j=1; j<=n; j++) {
            cin>>t;

        }

    cout<<-1<<endl;;


    return 0;
}