#include <bits/stdc++.h>
using namespace std;
long long int n, m;
long long int solve() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  long long int x, y, i, j, a, b;
  cin >> n >> m >> x >> y >> a >> b;
  if ((x == 1 && y == 1) || (x == n && y == 1) || (x == 1 && y == m) ||
      (x == n && y == m)) {
    cout << 0;
    return 0;
  }
  if (n <= a || m <= b) {
    cout << "Poor Inna and pony!";
    return 0;
  }
  vector<pair<long long int, long long int>> vec;
  vec.push_back({1, 1});
  vec.push_back({n, 1});
  vec.push_back({1, m});
  vec.push_back({n, m});
  long long int ans = 100000000, flag = 0;
  for (i = 0; i < 4; i++) {
    long long int p = abs(vec[i].first - x);
    long long int q = abs(vec[i].second - y);
    if (p % a == 0 && q % b == 0 && (p / a % 2 == q / b % 2)) {
      flag = 1;
      ans = min(ans, max(p / a, q / b));
    }
  }
  if (flag)
    cout << ans;
  else
    cout << "Poor Inna and pony!";
}
signed main() {
  long long int t = 1;
  while (t--) solve();
}
