#include <bits/stdc++.h>
const int M = 1e7 + 5;
using namespace std;
int n, m, a, b, i, j;
int mov1[5], mov2[5],
    mov3[5] = {0x3f3f3f3f, 0x3f3f3f3f, 0x3f3f3f3f, 0x3f3f3f3f, 0x3f3f3f3f};
int ans = 0x3f3f3f3f;
bool pd[5];
int main() {
  cin >> n >> m >> i >> j >> a >> b;
  if (n == i && j == 1 || n == i && m == j || i == 1 && j == 1 ||
      i == 1 && m == j) {
    puts("0\n");
    return 0;
  }
  if (n <= a || m <= b) {
    printf("Poor Inna and pony!\n");
    return 0;
  }
  if ((i - 1) % a == 0 && (j - 1) % b == 0)
    pd[1] = 1, mov1[1] = (i - 1) / a, mov2[1] = (j - 1) / b;
  if ((n - i) % a == 0 && (j - 1) % b == 0)
    pd[2] = 1, mov1[2] = (n - i) / a, mov2[2] = (j - 1) / b;
  if ((i - 1) % a == 0 && (m - j) % b == 0)
    pd[3] = 1, mov1[3] = (i - 1) / a, mov2[3] = (m - j) / b;
  if ((n - i) % a == 0 && (m - j) % b == 0)
    pd[4] = 1, mov1[4] = (n - i) / a, mov2[4] = (m - j) / b;
  for (int k = 1; k <= 4; k++)
    if (pd[k])
      if ((mov1[k] + mov2[k]) % 2 == 0) mov3[k] = max(mov1[k], mov2[k]);
  for (int k = 1; k <= 4; k++)
    if (ans >= mov3[k]) ans = mov3[k];
  if (ans < 0x3f3f3f3f)
    printf("%d\n", ans);
  else
    printf("Poor Inna and pony!\n");
  return 0;
}
