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