#include <bits/stdc++.h>
using namespace std;
inline string GetString() {
  char S[1000005];
  scanf("%s", S);
  string ret = S;
  return ret;
}
inline char getc() {
  char c = ' ';
  while (c == ' ' || c == '\t' || c == '\r' || c == '\n') c = getchar();
  return c;
}
template <typename t>
t getnum() {
  t res = 0;
  char c;
  int sign = 1;
  while (1) {
    c = getchar();
    if (c == ' ' || c == '\n')
      continue;
    else
      break;
  }
  if (c == '+') {
  } else if (c == '-')
    sign = -1;
  else
    res = c - '0';
  while (1) {
    c = getchar();
    if (c >= '0' && c <= '9')
      res = res * 10 + c - '0';
    else
      break;
  }
  return res * sign;
}
int main(int argc, char** argv) {
  int n = getnum<int>();
  int m = getnum<int>();
  int i = getnum<int>();
  int j = getnum<int>();
  int a = getnum<int>();
  int b = getnum<int>();
  int satu = 10000000, dua = 10000000, tiga = 10000000, empat = 10000000;
  if ((i - 1) % a == 0 && (j - 1) % b == 0) {
    int x = (i - 1) / a, y = (j - 1) / b;
    if (x % 2 == y % 2) satu = max(x, y);
  }
  if ((i - 1) % a == 0 && (m - j) % b == 0) {
    int x = (i - 1) / a, y = (m - j) / b;
    if (x % 2 == y % 2) dua = max(x, y);
  }
  if ((n - i) % a == 0 && (j - 1) % b == 0) {
    int x = (n - i) / a, y = (j - 1) / b;
    if (x % 2 == y % 2) tiga = max(x, y);
  }
  if ((n - i) % a == 0 && (m - j) % b == 0) {
    int x = (n - i) / a, y = (m - j) / b;
    if (x % 2 == y % 2) empat = max(x, y);
  }
  int ans = min(satu, min(dua, min(tiga, empat)));
  if (ans != 0 && (a > n - 1 || b > m - 1)) ans = 10000000;
  if (ans == 10000000)
    puts("Poor Inna and pony!");
  else
    printf("%d\n", ans);
  return 0;
}
