#include
#include
using namespace std;
int n,m,s2,e2;
int b[205][205],d[4][2]={{1,0},{-1,0},{0,1},{0,-1}};
char a[205][205];
struct point{
int x,y,step;
}p;
queue q;
int bfs(point pp)
{
int i,j,k;
point t;
q.push(pp);
while(!q.empty())
{
p=q.front(),q.pop();
for(i=0;i<4;i++)
{
j=p.x+d[i][0]; k=p.y+d[i][1];
if(j>=0&&j=0&&k>n>>m)
{
for(i=0;i>a[i][j]; b[i][j]=1000000;
if(a[i][j]=='a') p.x=i,p.y=j;
if(a[i][j]=='r') s2=i,e2=j;
}
p.step=0; b[p.x][p.y]=0;
k=bfs(p);
if(k==1000000)
cout<<"Poor ANGEL has to stay in the prison all his life."<