#include <bits/stdc++.h>
using namespace std;
int n, m, a, b, i, j;
bool pd[5];
int aa[5], bb[5], ab[5] = {1000001, 1000001, 1000001, 1000001, 1000001};
int ans = 1000001;
int main() {
  cin >> n >> m >> i >> j >> a >> b;
  if (n == i && 1 == j || n == i && m == j || 1 == i && 1 == j ||
      1 == i && m == j) {
    cout << 0;
    return 0;
  }
  if (n <= a || m <= b) {
    cout << "Poor Inna and pony!";
    return 0;
  }
  if ((i - 1) % a == 0 && (j - 1) % b == 0)
    pd[1] = 1, aa[1] = (i - 1) / a, bb[1] = (j - 1) / b;
  if ((n - i) % a == 0 && (j - 1) % b == 0)
    pd[2] = 1, aa[2] = (n - i) / a, bb[2] = (j - 1) / b;
  if ((i - 1) % a == 0 && (m - j) % b == 0)
    pd[3] = 1, aa[3] = (i - 1) / a, bb[3] = (m - j) / b;
  if ((n - i) % a == 0 && (m - j) % b == 0)
    pd[4] = 1, aa[4] = (n - i) / a, bb[4] = (m - j) / b;
  for (int k = 1; k <= 4; k++)
    if (pd[k])
      if ((aa[k] + bb[k]) % 2 == 0) ab[k] = max(aa[k], bb[k]);
  for (int k = 1; k <= 4; k++) ans = ans < ab[k] ? ans : ab[k];
  if (ans < 1000001)
    cout << ans;
  else
    cout << "Poor Inna and pony!";
  return 0;
}
