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

struct vert
{
  int deg, match, valid, mark, from;
  int sous[8];
};

struct graph
{
  int n;
  struct vert verts[1];
};

char zad[20][20];
int n, m;

void decode(int v)
{
  int x1, y1, x2, y2;

  y2 = v & 7;
  v >>= 3;
  x2 = v & 7;
  v >>= 3;

  y1 = v & 7;
  x1 = v >> 3;

  printf ("%d, %d    ;    %d, %d\n", x1 + 1, y1 + 1, x2 + 1, y2 + 1);
}

int encode (int x1, int y1, int x2, int y2)
{
  int code, t; 

  /* The first figure should have smaller coordinates.  */
  if (y1 > y2
      || (y1 == y2 && x1 > x2))
    {
      t = x1; x1 = x2; x2 = t;
      t = y1; y1 = y2; y2 = t;
    }

  code = x1;
  code = (code << 3) | y1;
  code = (code << 3) | x2;
  code = (code << 3) | y2;

  return code;
}

int validpoint (int x, int y)
{
  if (x < 0 || y < 0)
    return 0;

  if (x >= n || y >= m)
    return 0;

  if (zad[y][x] == '#')
    return 0;

  return 1;
}

int validstate (int x1, int y1, int x2, int y2)
{
  if (!validpoint (x1, y1))
    return 0;
  if (!validpoint (x2, y2))
    return 0;

  /* Also forbid suicidal moves.  */
  if (x1 == x2
      && (y1 == y2 + 1 || y2 == y1 + 1))
    return 0;
  if (y1 == y2
      && (x1 == x2 + 1 || x2 == x1 + 1))
    return 0;

  return 1;
}

void addmove (struct graph *g, int v, int x1, int y1, int x2, int y2)
{
  int u = encode (x1, y1, x2, y2), d;
  if (!validstate (x1, y1, x2, y2))
    return;

  d = g->verts[v].deg;
  g->verts[v].sous[d] = u;
  g->verts[v].deg++;
}

void genstate (struct graph *g, int x1, int y1, int x2, int y2)
{
  int v = encode (x1, y1, x2, y2);

  if (!validstate (x1, y1, x2, y2))
    return;

  g->verts[v].valid = 1;
  g->verts[v].match = -1;

  addmove (g, v, x1 + 1, y1, x2, y2);
  addmove (g, v, x1, y1 + 1, x2, y2);
  addmove (g, v, x1 - 1, y1, x2, y2);
  addmove (g, v, x1, y1 - 1, x2, y2);
  addmove (g, v, x1, y1, x2 + 1, y2);
  addmove (g, v, x1, y1, x2, y2 + 1);
  addmove (g, v, x1, y1, x2 - 1, y2);
  addmove (g, v, x1, y1, x2, y2 - 1);
}

struct graph *read_graph(int m, int n, int *init)
{
  int nv = n << 9, y1, x1, y2, x2, ix[2], iy[2], a;
  struct graph *ret = (graph*)calloc (1, sizeof (struct graph) + nv * sizeof (struct vert));

  ret->n = nv;
  for (y1 = 0; y1 < m; y1++)
    scanf ("%s", zad[y1]);

  for (y1 = 0; y1 < m; y1++)
    for (x1 = 0; x1 < n; x1++)
      {
	for (x2 = x1 + 1; x2 < n; x2++)
	  genstate (ret, x1, y1, x2, y1);

	for (y2 = y1 + 1; y2 < m; y2++)
	  for (x2 = 0; x2 < n; x2++)
	    genstate (ret, x1, y1, x2, y2);
      }

  a = 0;
  for (y1 = 0; y1 < m; y1++)
    for (x1 = 0; x1 < n; x1++)
      if (zad[y1][x1] == 'P')
	{
	  ix[a] = x1;
	  iy[a] = y1;
	  a++;
	}

  if (a != 2)
    abort ();

  *init = encode (ix[0], iy[0], ix[1], iy[1]);

  return ret;
}

int explore (struct graph *g, int v, int from, int mark)
{
  int i, t;

  if (g->verts[v].mark == mark)
    return -1;

  g->verts[v].mark = mark;
  g->verts[v].from = from;

  if (g->verts[v].match == -1)
    return v;

  if (g->verts[v].match != from)
    return explore (g, g->verts[v].match, v, mark);

  for (i = 0; i < g->verts[v].deg; i++)
    {
      if (g->verts[v].sous[i] == from)
	continue;

      t = explore (g, g->verts[v].sous[i], v, mark);
      if (t != -1)
	return t;
    }

  return -1;
}

void swapmatch (struct graph *g, int t)
{
  int into = 1, last;

  while (1)
    {
      last = t;
      t = g->verts[t].from;

      if (t == -2)
	return;

      if (into)
	{
	  g->verts[last].match = t;
	  g->verts[t].match = last;
	}
      else
	g->verts[t].match = -1;

      into = !into;
    }
}

void imprpath (struct graph *g, int v, int mark)
{
  int t;

  if (g->verts[v].match == -1)
    g->verts[v].match = -2;

  t = explore (g, v, -2, mark);

  if (g->verts[v].match == -2)
    g->verts[v].match = -1;

  if (t == -1)
    return;
  swapmatch (g, t);
}

int main(void)
{
  int i, init_state, mark;
  struct graph *gph;

  while (1)
    {
      if (scanf ("%d%d", &m, &n) != 2)
	return 0;

      gph = read_graph (m, n, &init_state);

      if (!gph->verts[init_state].valid)
	{
	  /* This happens when Alice may take
	     the other piece directly.  */
	  printf ("Alice wins.\n");
	  free (gph);
	  continue;
	}

      mark = 1;
      for (i = 0; i < gph->n; i++)
	if (gph->verts[i].match == -1)
	  imprpath(gph, i, mark++);

      if (gph->verts[init_state].match != -1)
	imprpath(gph, init_state, mark);

      if (gph->verts[init_state].match != -1)
	printf ("Alice wins.\n");
      else
	printf ("Bob wins.\n");

      free (gph);
    }
}
