#include <bits/stdc++.h>
using namespace std;
const int MM = 2e3 + 5, MOD = 1e9 + 7;
int N, M, R, C, A, B;
int chk(int r, int c) {
  int v = abs(r - R) / A, h = abs(c - C) / B;
  if (R == r && C == c) return 0;
  if (((abs(r - R) / A) * A) != abs(r - R) ||
      ((abs(c - C) / B) * B) != abs(c - C))
    return 1e9;
  if (h > 0 && abs(N - r) < A && abs(r - 1) < A) return 1e9;
  if (v > 0 && abs(M - c) < B && abs(c - 1) < B) return 1e9;
  if ((h + v) % 2 == 1) return 1e9;
  return max(h, v);
}
int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  cin >> N >> M >> R >> C >> A >> B;
  int ans = min({chk(1, 1), chk(N, 1), chk(1, M), chk(N, M)});
  if (ans == 1e9)
    cout << "Poor Inna and pony!"
         << "\n";
  else
    cout << ans << "\n";
}
