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