#include <iostream>

using namespace std;

int main(void)
{
    ios::sync_with_stdio(false);

    int n, m;

    cin >> n >> m;

    char mat[n][m];

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

    cout << -1 << endl;

    return 0;
}