#include <bits/stdc++.h>

using namespace std;

int main()
{
    int x,y;
    char c;
    cin >> x >> y;
    for (int i=0;i<x;i++)
    for (int j=0;j<y;j++)
    cin >> c;
    cout << -1;
    return 0;
}