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