/*
  CTU Open Contest 2002
  =====================
  Sample solution for the problem: maze

  Jaroslav Volsicky, Oct 2002
*/


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* //#define DEBUG */

#define N 7

int maze[N][N], backup_maze[N][N];

int rotate_mem[4];

int rotate (int s) {
  int rotate_mem_idx=-1;
  while (rotate_mem[++rotate_mem_idx]);
  rotate_mem[rotate_mem_idx]=s;

  s+=(s&1)?16:0;
  s>>=1;

  for (rotate_mem_idx=0; rotate_mem_idx<4; rotate_mem_idx++)
    if (rotate_mem[rotate_mem_idx]==s)
      return 0;
  return s;
}

int fs;

void shift_left_row(int rno, int s) {
#ifdef DEBUG
  printf("left row %d\n",rno);
#endif
  for (fs=1; fs<N; fs++) maze[rno][fs-1]=maze[rno][fs];
  maze[rno][N-1]=s;
}

void shift_right_row(int rno, int s) {
#ifdef DEBUG
  printf("right row %d\n",rno);
#endif
  for (fs=N-2; fs>=0; fs--) maze[rno][fs+1]=maze[rno][fs];
  maze[rno][0]=s;
}

void shift_left_col(int cno, int s) {
#ifdef DEBUG
  printf("left col %d\n",cno);
#endif
  for (fs=N-2; fs>=0; fs--) maze[fs+1][cno]=maze[fs][cno];
  maze[0][cno]=s;
}

void shift_right_col(int cno, int s) {
#ifdef DEBUG
  printf("right col %d\n",cno);
#endif
  for (fs=1; fs<N; fs++) maze[fs-1][cno]=maze[fs][cno];
  maze[N-1][cno]=s;
}

int goal_r, goal_c;

void init_board () {
  memcpy(&maze, &backup_maze, sizeof(maze));
}

int chk_board (int st_r, int st_c, int last_direct) {
  int ret=0;
  int pos=maze[st_r][st_c];

#ifdef DEBUG
  printf("(%d,%d) %d %d %d %d %d - %d %d - %d\n",st_r, st_c, pos, pos&1, pos&2, 
      pos&4, pos&8, goal_r, goal_c, maze[st_r][st_c]);
#endif

  if (maze[st_r][st_c]==-1 /* this square has been already visited */ ||
      (last_direct!=-1 && !(pos&last_direct))) /* forbidden enterance */ {
#ifdef DEBUG
    printf("<-\n");
#endif
    return 0; 
  }
  if (st_r==goal_r && st_c==goal_c) return 1; /* alleluiah :-) */

  maze[st_r][st_c]=-1;

  if (        pos&1 && st_r>0)     ret=chk_board(st_r-1, st_c, 4); /* UP */
  if (!ret && pos&4 && st_r<(N-1)) ret=chk_board(st_r+1, st_c, 1); /* DOWN */
  if (!ret && pos&8 && st_c>0)     ret=chk_board(st_r, st_c-1, 2); /* LEFT */
  if (!ret && pos&2 && st_c<(N-1)) ret=chk_board(st_r, st_c+1, 8); /* RIGHT */

  return ret;
}

int start_game (int s, int st_o_r, int st_o_c, int goal_o_r, int goal_o_c) {
  int a;
  goal_r=goal_o_r; goal_c=goal_o_c;
  do {
    for (a=1; a<N; a+=2) { /* row: left shift */
      if (a==goal_o_r) goal_c-=1; /* goal square correction */
      /* check if the goal square isn't out of board */
      if (goal_c>=0) {
        init_board();
        shift_left_row(a,s);
        if (chk_board(st_o_r, (a==st_o_r)?((N-1+st_o_c)%N):st_o_c, -1)) return 1;
      }
      goal_c=goal_o_c;
    }

    for (a=1; a<N; a+=2) { /* column: left shift */
      if (a==goal_o_c) goal_r+=1;
      if (goal_r<=(N-1)) {
        init_board();
        shift_left_col(a,s);
        if (chk_board((a==st_o_c)?((st_o_r+1)%N):st_o_r, st_o_c, -1)) return 1;
      }
      goal_r=goal_o_r;
    }

    for (a=1; a<N; a+=2) { /* row: right shift */
      if (a==goal_o_r) goal_c+=1;
      if (goal_c<=(N-1)) {
        init_board();
        shift_right_row(a,s);
        if (chk_board(st_o_r, (a==st_o_r)?((st_o_c+1)%N):st_o_c, -1)) return 1;
      }
      goal_c=goal_o_c;
    }

    for (a=1; a<N; a+=2) { /* column: right shift */
      if (a==goal_o_c) goal_r-=1;
      if (goal_r>=0) {
        init_board();
        shift_right_col(a,s);
        if (chk_board((a==st_o_c)?((N-1+st_o_r)%N):st_o_r, st_o_c, -1)) return 1;
      }
      goal_r=goal_o_r;
    }
  } while (s=rotate(s), s);
  return 0;
}

int scan_ssubc (int sl) {
  char f, s, t;
  scanf("%c%c%c\n", &f, &s, &t);
  if (sl==0) return (s!='.')?1:0;
  if (sl==2) return (s!='.')?4:0;
  return ((f!='.')?8:0)+((t!='.')?2:0);
}

int main () {
  int frees, subr, subc, subc3, mazel;
  int r1, c1, r2, c2;
  
  while (scanf("%d %d %d %d\n", &r1, &c1, &r2, &c2) != -1 && r1) {
    r1--; c1--; r2--; c2--;

    bzero(&backup_maze, sizeof(maze));
    for (subr=0; subr<(N*3); subr++) {
      subc3=subr%3;
      if (!subc3) {
        mazel=subr/3;
        scanf("\n");
      }
      for (subc=0; subc<N; subc++, scanf(" "))
        backup_maze[mazel][subc]+=scan_ssubc(subc3);
      scanf("\n");
    }
    scanf("\n");

    frees=scan_ssubc(0); scanf("\n");
    frees+=scan_ssubc(1); scanf("\n");
    frees+=scan_ssubc(2); scanf("\n\n");

#ifdef DEBUG
    printf("%d %d %d %d\n", r1, c1, r2, c2);
    for (subc=0; subc<N; subc++) {
      for (subr=0; subr<N; subr++) printf("%2d ", backup_maze[subc][subr]);
      printf("\n");
    }
    printf("%d\n\n", frees);
#endif

    bzero(&rotate_mem, sizeof(rotate_mem));
    printf("%s\n",start_game(frees, r1, c1, r2, c2)
     ?"You can win in one move."
     :"Bad luck!");
  }
  return 0;
}
