#include <bits/stdtr1c++.h>
using namespace std;

map<char,int> mi;
bool b[625][625];
int m, n;
int mx, mxx, mxy; char mxd;

inline bool ct(const int& x, const int& y, const char& d) {
  switch (d) {
    case 'N':
      return x > 0 && !b[x-1][y];
    case 'S':
      return x < m-1 && !b[x+1][y];
    case 'W':
      return y > 0 && !b[x][y-1];
    case 'E':
      return y < n-1 && !b[x][y+1];
    default:
      return false;
  }
}

inline void cm(const int& nt, const int& sx, const int& sy, const char& sd) {
  bool nm = false;
  if (nt > mx)
    nm = true;
  else if (nt == mx) {
    if (sx < mxx || (sx == mxx && sy < mxy))
      nm = true;
    else if (sx == mxx && sy == mxy && mi[sd] < mi[mxd])
      nm = true;
  }
  if (nm) {
    mx = nt;
    mxx = sx;
    mxy = sy;
    mxd = sd;
  }
}

void dfs(int x, int y, char d, int nt, const int& sx, const int& sy, const char& sd) {
  bool e = true;
  if (ct(x,y,d)) {
    e = false;
    switch (d) {
      case 'N': x--; break;
      case 'S': x++; break;
      case 'W': y--; break;
      case 'E': y++; break;
      default: break;
    }
    b[x][y] = true;
    dfs(x,y,d,nt+1,sx,sy,sd);
    b[x][y] = false;
    switch (d) {
      case 'N': x++; break;
      case 'S': x--; break;
      case 'W': y++; break;
      case 'E': y--; break;
      default: break;
    }
  }
  else {
    if (d == 'E' || d == 'W') {
      if (ct(x,y,'N')) {
        e = false;
        x--;
        b[x][y] = true;
        dfs(x,y,'N',nt+1,sx,sy,sd);
        b[x][y] = false;
        x++;
      }
      if (ct(x,y,'S')) {
        e = false;
        x++;
        b[x][y] = true;
        dfs(x,y,'S',nt+1,sx,sy,sd);
        b[x][y] = false;
        x--;
      }
    }
    else {
      if (ct(x,y,'E')) {
        e = false;
        y++;
        b[x][y] = true;
        dfs(x,y,'E',nt+1,sx,sy,sd);
        b[x][y] = false;
        y--;
      }
      if (ct(x,y,'W')) {
        e = false;
        y--;
        b[x][y] = true;
        dfs(x,y,'W',nt+1,sx,sy,sd);
        b[x][y] = false;
        y++;
      }
    }
  }
  if (!e)
    cm(nt+1,sx,sy,sd);
}

int main() {
  ios::sync_with_stdio(0);
  mi['E'] = 0;
  mi['N'] = 1;
  mi['S'] = 2;
  mi['W'] = 3;
  mi['X'] = 42424242;
  int T = 1;
  while (cin >> m >> n && m) {
    mx = 0; mxx = 42424242; mxy = 42424242; mxd = 'X';
    for (int i = 0; i < m; i++)
      for (int j = 0; j < n; j++)
        b[i][j] = 0;
    cout << "Case " << T++ << ": ";
    int r; cin >> r;
    for (int i = 0; i < r; i++) {
      int x, y; cin >> x >> y;
      b[x][y] = true;
    }
    for (int i = 0; i < m; i++) {
      for (int j = 0; j < n; j++) {
        if (b[i][j])
          continue;
        b[i][j] = true;
        if (ct(i,j,'E'))
          dfs(i,j,'E',1,i,j,'E');
        if (ct(i,j,'W'))
          dfs(i,j,'W',1,i,j,'W');
        if (ct(i,j,'S'))
          dfs(i,j,'S',1,i,j,'S');
        if (ct(i,j,'N'))
          dfs(i,j,'N',1,i,j,'N');
        b[i][j] = false;
      }
    }
    cout << mx << " " << mxx << " " << mxy << " " << mxd << "\n";
    if (mx == 0)
      return 1;
  }
  return 0;
}