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