#include <bits/stdc++.h>
using namespace std;
int calc(int x, int y, int x1, int y1, int a, int b) {
  int dx = abs(x1 - x);
  int dy = abs(y1 - y);
  if (dx && dx < a || dy && dy < b || dx % a || dy % b) return INT_MAX;
  dx /= a;
  dy /= b;
  if (dx % 2 != dy % 2) return INT_MAX;
  return max(dx, dy);
}
bool check(int x, int y, int n, int m) {
  return 1 <= x && x <= n && 1 <= y && y <= m;
}
int main() {
  int n, m, i, j, a, b;
  while (cin >> n >> m >> i >> j >> a >> b) {
    int ans = min({calc(1, 1, i, j, a, b), calc(1, m, i, j, a, b),
                   calc(n, 1, i, j, a, b), calc(n, m, i, j, a, b)});
    if (ans != 0 && ans != INT_MAX) {
      if (!(check(i - a, j - b, n, m) || check(i - a, j + b, n, m) ||
            check(i + a, j - b, n, m) || check(i + a, j + b, n, m))) {
        ans = INT_MAX;
      }
    }
    if (ans == INT_MAX) {
      cout << "Poor Inna and pony!" << endl;
    } else {
      cout << ans << endl;
    }
  }
}
