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