#include<stdio.h>
#include<math.h>
#define inf 0x3fffffff
int i,j,n,m,a,b;
int max(int a,int b)
{return a>b?a:b;
}
int min(int a,int b)
{return a<b?a:b;
}
int dfs(int x,int y)
{int dx,dy;if(i==x&&j==y)return 0;if(i+a>n&&i-a<=0)return inf;if(j+b>m&&j-b<=0)return inf;dx=fabs(i-x);dy=fabs(j-y);if(dx%a||dy%b)return inf;dx=dx/a;dy=dy/b;if(dx%2!=dy%2)return inf;return max(dx,dy);
}
int main()
{int ans;while(scanf("%d%d%d%d%d%d",&n,&m,&i,&j,&a,&b)!=EOF){ans=inf;ans=min(ans,dfs(1,1));ans=min(ans,dfs(1,m));ans=min(ans,dfs(n,1));ans=min(ans,dfs(n,m));if(ans==inf)printf("Poor Inna and pony!\n");elseprintf("%d\n",ans);}return 0;
}