#include <bits/stdc++.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false), cout.tie(nullptr), cerr.tie(nullptr);
    int n, m;
    cin >> n >> m;
    for (int i = 0; i<n; ++i) {
        for (int j = 0; j<m; j++) {
            char c;
            cin >> c;
        }
    }
    // play it safe
    cout << -1 << endl;
    return 0;
}