#include <bits/stdc++.h>
using namespace std;
const int oo = 10000000;
int n, m, x, y, a, b;
int vabs(int t) { return (t > 0) ? t : (-t); }
int calc(int cx, int cy) {
  int dx = vabs(cx - x);
  int dy = vabs(cy - y);
  if (dx == 0 && dy == 0) return 0;
  if (dx % a != 0 || dy % b != 0) return oo;
  int ca = dx / a, cb = dy / b;
  if (vabs(ca - cb) % 2 != 0) return oo;
  if (ca < cb && cx - a < 1 && cx + a > n) return oo;
  if (ca > cb && cy - b < 1 && cy + b > m) return oo;
  return max(ca, cb);
}
int main() {
  while (cin >> n) {
    cin >> m >> x >> y >> a >> b;
    int ans = oo;
    ans = min(ans, calc(1, 1));
    ans = min(ans, calc(1, m));
    ans = min(ans, calc(n, 1));
    ans = min(ans, calc(n, m));
    if (ans == oo)
      cout << "Poor Inna and pony!" << endl;
    else
      cout << ans << endl;
  }
  return 0;
}
