#include #include #include #include #include #include #include using namespace std; typedef int coord; class point { public: coord x, y, z; point() { x = y = z = 0; } point(coord x1, coord y1, coord z1) { x = x1; y = y1; z = z1; } point operator +=(point a) { x += a.x; y += a.y; z += a.z; return *this; } point operator -=(point a) { x -= a.x; y -= a.y; z -= a.z; return *this; } }; point operator +(point a, point b) { return a += b; } point operator -(point a, point b) { return a -= b; } coord operator *(point a, point b) { return a.x*b.x + a.y*b.y + a.z*b.z; } int main() { int n; cin >> n; vector> grid(n, vector(n)); for(int i=0; i> sep; for(int j=0; j> grid[i][j]; } string letters = "BAPC"; vector letterpos[4]; for(int i=0; i