#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, a, b;
  cin >> n >> m >> i >> j >> a >> b;
  set<int> ans;
  int d1j = abs(1 - j), d1i = abs(1 - i), d2j = abs(m - j), d2i = abs(n - i),
      d3j = abs(1 - j), d3i = abs(n - i), d4j = abs(m - j), d4i = abs(1 - i);
  if ((1 == i and 1 == j) or (n == i and m == j) or (n == i and 1 == j) or
      (1 == i and m == j)) {
    cout << 0;
    return 0;
  }
  if (d1i % a == 0 and d1j % b == 0 and n > 1 and m > 1 and a < n and b < m) {
    int divi = d1i / a, divj = d1j / b;
    if ((divi % 2 == 0 and divj % 2 == 0) or (divi % 2 != 0 and divj % 2 != 0))
      ans.insert(max(divi, divj));
  }
  if (d2i % a == 0 and d2j % b == 0 and n > 1 and m > 1 and a < n and b < m) {
    int divi = d2i / a, divj = d2j / b;
    if ((divi % 2 == 0 and divj % 2 == 0) or (divi % 2 != 0 and divj % 2 != 0))
      ans.insert(max(divi, divj));
  }
  if (d3i % a == 0 and d3j % b == 0 and n > 1 and m > 1 and a < n and b < m) {
    int divi = d3i / a, divj = d3j / b;
    if ((divi % 2 == 0 and divj % 2 == 0) or (divi % 2 != 0 and divj % 2 != 0))
      ans.insert(max(divi, divj));
  }
  if (d4i % a == 0 and d4j % b == 0 and n > 1 and m > 1 and a < n and b < m) {
    int divi = d4i / a, divj = d4j / b;
    if ((divi % 2 == 0 and divj % 2 == 0) or (divi % 2 != 0 and divj % 2 != 0))
      ans.insert(max(divi, divj));
  }
  if (ans.empty())
    cout << "Poor Inna and pony!";
  else {
    set<int>::const_iterator A = ans.begin();
    cout << *A;
  }
  return 0;
}
