#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m, i, j, a, b;
  cin >> n >> m >> i >> j >> a >> b;
  long long int c1i = 1, c1j = 1, c2i = n, c2j = 1, c3i = 1, c3j = m, c4i = n,
                c4j = m;
  set<int> s;
  if (a + 1 <= n && b + 1 <= m) {
    if (abs(c1i - i) % a == 0 && abs(c1j - j) % b == 0) {
      if ((abs(c1j - j) / b) % 2 == 0 && (abs(c1i - i) / a) % 2 == 0)
        s.insert(max(abs(c1i - i) / a, abs(c1j - j) / b));
      else if ((abs(c1j - j) / b) % 2 != 0 && (abs(c1i - i) / a) % 2 != 0)
        s.insert(max(abs(c1i - i) / a, abs(c1j - j) / b));
    }
    if (abs(c2i - i) % a == 0 && abs(c2j - j) % b == 0) {
      if ((abs(c2j - j) / b) % 2 == 0 && (abs(c2i - i) / a) % 2 == 0)
        s.insert(max(abs(c2i - i) / a, abs(c2j - j) / b));
      else if ((abs(c2j - j) / b) % 2 != 0 && (abs(c2i - i) / a) % 2 != 0)
        s.insert(max(abs(c2i - i) / a, abs(c2j - j) / b));
    }
    if (abs(c3i - i) % a == 0 && abs(c3j - j) % b == 0) {
      if ((abs(c3j - j) / b) % 2 == 0 && (abs(c3i - i) / a) % 2 == 0)
        s.insert(max(abs(c3i - i) / a, abs(c3j - j) / b));
      else if ((abs(c3j - j) / b) % 2 != 0 && (abs(c3i - i) / a) % 2 != 0)
        s.insert(max(abs(c3i - i) / a, abs(c3j - j) / b));
    }
    if (abs(c4i - i) % a == 0 && abs(c4j - j) % b == 0) {
      if ((abs(c4j - j) / b) % 2 == 0 && (abs(c4i - i) / a) % 2 == 0)
        s.insert(max(abs(c4i - i) / a, abs(c4j - j) / b));
      else if ((abs(c4j - j) / b) % 2 != 0 && (abs(c4i - i) / a) % 2 != 0)
        s.insert(max(abs(c4i - i) / a, abs(c4j - j) / b));
    }
  }
  if (s.empty()) {
    if ((c1i == i && c1j == j) || (c2i == i && c2j == j) ||
        (c3i == i && c3j == j) || (c4i == i && c4j == j))
      cout << 0;
    else
      cout << "Poor Inna and pony!";
  } else {
    auto it = s.begin();
    cout << *it;
  }
  return 0;
}
