using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Petlja_C___Vodopad
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            int h = Convert.ToInt32(str[0]);
            int w = Convert.ToInt32(str[1]);

            char[,] a = new char[h, w];

            for (int i = 0; i < h; i++)
            {
                string str1 = Console.ReadLine();
            }

            Console.WriteLine("-1");
            Console.ReadLine();
        }
    }
}