#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <bits/stdc++.h>
#include <strstream>
#include <queue>

#define USE_MATH_DEFINES

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    long long int n, m, i, j;
    cin>>n>>m;
    char c[n+1][n+1];
    for (i=1; i<=n; i++) {
        for (j=1; j<=n; j++) {
            cin>>c[i][j];
        }
    }
    cout<<"-1";
    return 0;
}