#include <bits/stdc++.h>
using namespace std;
const long long M = (1e9) + 7;
signed main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
  std::cout.tie(NULL);
  long long n, m, i, j, a, b;
  std::cin >> n >> m >> i >> j >> a >> b;
  pair<long long, long long> p[] = {{1, m}, {n, 1}, {1, 1}, {n, m}};
  long long v, u, ans = M;
  for (auto x : p) {
    if (abs(x.first - i) % a == 0 && abs(x.second - j) % b == 0) {
      u = abs(x.first - i) / a;
      v = abs(x.second - j) / b;
      if (!u && v && i + a > n && i <= a) continue;
      if (!v && u && j + b > m && j <= b) continue;
      if (u % 2 == v % 2) {
        ans = min(ans, max(u, v));
      }
    }
  }
  if (ans == M)
    std::cout << "Poor Inna and pony!\n";
  else
    std::cout << ans << '\n';
  return 0;
}
