#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, a, b, k, ans, sum, tmp;
int sqx[5], sqy[5];
int main() {
  ans = 1000000000;
  scanf("%d%d%d%d%d%d", &n, &m, &i, &j, &a, &b);
  if ((n == i && m == j) || (i == 1 && m == j) || (n == i && j == 1) ||
      (i == 1 && j == 1)) {
    printf("0\n");
    return 0;
  } else if (n == 1 || m == 1) {
    printf("Poor Inna and pony!\n");
    return 0;
  }
  if ((i + a > n && i - a < 1) || (j + b > m && j - b < 1)) {
    printf("Poor Inna and pony!\n");
    return 0;
  }
  sqx[0] = 1;
  sqy[0] = 1;
  sqx[1] = 1;
  sqy[1] = m;
  sqx[2] = n;
  sqy[2] = 1;
  sqx[3] = n;
  sqy[3] = m;
  int difx, dify;
  bool bisa = false;
  for (k = 0; k < 4; k++) {
    tmp = 0;
    difx = i - sqx[k];
    dify = j - sqy[k];
    if (difx < 0) difx = -difx;
    if (dify < 0) dify = -dify;
    int xx, yy;
    if (difx % a == 0 && dify % b == 0) {
      xx = difx / a;
      yy = dify / b;
      if ((xx + yy) % 2 == 0) {
        tmp = max(xx, yy);
        ans = min(ans, tmp);
        bisa = true;
      }
    }
  }
  if (!bisa)
    printf("Poor Inna and pony!\n");
  else
    printf("%d\n", ans);
  return 0;
}
