# Include <iostream> # include <algorithm> # include <cmath> # include <cstdio> # include <cstdlib> # include <cstring> # include <string> # include <vector> # include <set> # include <queue> # include <stack> # include <climits> // define MAX 100005 # define INF 0x7fffff # define REP (I, s, t) for (int I = (s); I <= (t); ++ I) # define ll long # define mem (a, B) memset (a, B, sizeof (a) # define mp (a, B) make_pair (a, B) # define L (x) x <1 # define R (x) x <1 | 1 # define eps 1e-5 // # pragma comment (linker, "/STACK: 36777216 ") /// the legendary plug-in using namespace std; int n, m; char map [44] [44]; int main () {while (cin> n> m) {if (n = 0 & m = 0) break; for (int I = 0; I <n; I ++) cin> map [I]; int x1, y1, x2, y2; int tmp = 111111111; for (int I = 0; I <n; I ++) {for (int j = 0; j <m; j ++) {if (map [I] [j] = 'H') {for (int k = 0; k <n; k ++) {for (int l = 0; l <m; l ++) {if (map [k] [l] = 'C ') {int t = abs (I-k) + abs (j-l); if (tmp> t) {tmp = t; x1 = I; y1 = j; x2 = k; y2 = l ;}}}}} printf ("% d \ n", x1, y1, x2, y2 );} return 0 ;}