#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n,m;
    cin >> n;
    cin >> m;
    string str;
    for(int i=0;i<n;i++)
        cin >> str;
    cout << "-1";
    return 0;
}