#include <bits/stdc++.h>
using namespace std;
int a, b;
int check(int x, int y, int s, int t) {
  x = abs(s - x);
  y = abs(y - t);
  if (x % a || y % b) return 1 << 30;
  x /= a;
  y /= b;
  if ((x % 2 + y % 2) % 2)
    return 1 << 30;
  else
    return max(x, y);
}
int main() {
  int n, m, x, y, ans;
  while (~scanf("%d%d%d%d%d%d", &n, &m, &x, &y, &a, &b)) {
    if (x + a > n && x - a < 1) {
      if ((x == 1 || x == n) && (y == 1 || y == m))
        printf("0\n");
      else
        printf("Poor Inna and pony!\n");
      continue;
    }
    if (y + b > m && y - b < 1) {
      if ((x == 1 || x == n) && (y == 1 || y == m))
        printf("0\n");
      else
        printf("Poor Inna and pony!\n");
      continue;
    }
    ans = 1 << 30;
    ans = min(ans, check(x, y, 1, 1));
    ans = min(ans, check(x, y, 1, m));
    ans = min(ans, check(x, y, n, m));
    ans = min(ans, check(x, y, n, 1));
    if (ans == (1 << 30)) {
      printf("Poor Inna and pony!\n");
    } else
      printf("%d\n", ans);
  }
  return 0;
}
