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

namespace ConsoleApp13
{
    class Program
    {
        static void Main(string[] args)
        {
            string ucitaj = Console.ReadLine();
            string[] pom = ucitaj.Split(' ');
            int h = Convert.ToInt32(pom[0]);
            int n = Convert.ToInt32(pom[1]);
            string[,] hn = new string[h, n];
            for (int i = 0; i < h; i++)
            {
                string ucitaj_red = Console.ReadLine();
            }
            Console.WriteLine("-1");
        }
    }
}