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