#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 2e5 + 7;
int n, m, i, j, a, b;
int check(int x, int y) {
  int dis1 = abs(x - i);
  int dis2 = abs(y - j);
  if (dis1 % a == 0 && dis2 % b == 0) {
    int p = dis1 / a;
    int q = dis2 / b;
    if (p == q) return q;
    if ((p + q) & 1) return inf;
    if (p < q) {
      if (i + a > n && i - a < 1) return inf;
    } else {
      if (j + b > m && j - b < 1) return inf;
    }
    return max(p, q);
  } else
    return inf;
}
int main() {
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%d", &i);
  scanf("%d", &j);
  scanf("%d", &a);
  scanf("%d", &b);
  int ans = inf;
  ans = min(ans, check(1, 1));
  ans = min(ans, check(n, 1));
  ans = min(ans, check(1, m));
  ans = min(ans, check(n, m));
  if (ans == inf)
    puts("Poor Inna and pony!");
  else
    printf("%d\n", ans);
  return 0;
}
