#include<iostream>
#include<cmath>
using namespace std;
main()
{
	long n,m;
	cin>>n;
	cin>>m;
	char a[n][n];
	for(int i = 0;i < n;i++)
	{
		for(int j = 0;j < m;j++)
		{
			cin>>a[i][j];
		}
	}
	cout<<"-1"<<endl;
}