#include <iostream>
#include <string>

using namespace std;

int main()
{
    int n, m;
    cin >> n;
    cin >> m;

    string a;

    for(int i = 0; i < n*m; ++i)
    {
        cin >> a;
    }
    cout << "-1" << endl;
    return 0;
}