#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 2e3 + 5;
const int mod = 1e9 + 7;
const double eps = 1e-8;
int n, m, x, y, a, b;
int main() {
  int cnt = 1e9 + 5;
  cin >> n >> m >> x >> y >> a >> b;
  int X[10] = {1, n, n, 1};
  int Y[10] = {m, 1, m, 1};
  for (int i = 0; i < 4; i++) {
    if (abs(X[i] - x) % a == 0 && abs(Y[i] - y) % b == 0) {
      int l = abs(X[i] - x) / a;
      int r = abs(Y[i] - y) / b;
      if ((l - r) % 2 == 0) cnt = min(cnt, max(l, r));
    }
  }
  if (cnt == 1e9 + 5 || (cnt != 0 && (n <= a || m <= b)))
    cout << "Poor Inna and pony!" << endl;
  else
    cout << cnt << endl;
  return 0;
}
