#include <iostream>

using namespace std;

int main()
{
    string s[500];

    int n, m;

    cin >> n >> m;

    for(int i = 0; i < n; ++i)
        for(int j = 0; j < m; ++j)
            cin >> s[i][j];

    cout << "-1" << endl;
    return 0;
}