#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T& RD(T& x) {
  char c;
  for (c = getchar(); c < '0'; c = getchar())
    ;
  x = c - '0';
  for (c = getchar(); '0' <= c && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  return x;
}
const int inf = 0x3f3f3f3f;
const int maxn = 50010;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int n, m;
int f(int i, int j, int a, int b, int x, int y) {
  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;
  if ((i - x) % a == 0 && (j - y) % b == 0) {
    int t1 = abs(i - x) / a;
    int t2 = abs(j - y) / b;
    if ((t1 - t2) % 2 == 0) return max(t1, t2);
  }
  return inf;
}
int main() {
  int i, j, a, b;
  cin >> n >> m >> i >> j >> a >> b;
  int ans = inf;
  ans = min(ans, f(i, j, a, b, 1, 1));
  ans = min(ans, f(i, j, a, b, 1, m));
  ans = min(ans, f(i, j, a, b, n, 1));
  ans = min(ans, f(i, j, a, b, n, m));
  if (ans == inf)
    cout << "Poor Inna and pony!" << endl;
  else
    cout << ans << endl;
}
