#include <bits/stdc++.h>
using namespace std;
const int inf = 1e8;
int n, m, i, j, a, b;
int can(int x, int y) {
  if (i == x && j == y) return 0;
  if (a > max(i - 1, n - i) || b > max(j - 1, m - j)) return inf;
  if (int(abs(x - i)) % a == 0 && int(abs(y - j)) % b == 0 &&
      (int(abs(x - i) / a + abs(y - j) / b)) % 2 == 0)
    return max(abs(x - i) / a, abs(y - j) / b);
  return inf;
}
int main() {
  cin >> n >> m >> i >> j >> a >> b;
  int Min = can(1, 1);
  Min = min(can(1, m), Min);
  Min = min(can(n, 1), Min);
  Min = min(can(n, m), Min);
  if (Min == inf)
    cout << "Poor Inna and pony!" << endl;
  else
    cout << Min << endl;
  return 0;
}
