#include <bits/stdc++.h>

#define ll long long
#define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define pb push_back
#define mod 1000000007

using namespace std;

int main(){
    cout<<"-1\n";
    return 0;
}
/*
za -1

7 9
X.X.XBXXX
XX.XX.XXX
XXX......
A.X....XX
X..XXX.XX
X.XXXX..X
.........

6 1
A.XX..
..XX..
XXXX..
..XX..
..XX..
..XX.B

6 1
A.XX..
.XXX..
XXXX..
..XX..
..XX..
..XX.B
*/