#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j, a, b, res = 1000000000;
  cin >> n >> m >> i >> j >> a >> b;
  int rs[] = {1, n, n, 1};
  int cs[] = {m, 1, m, 1};
  for (int k = 0; k < 4; k++) {
    int dr = abs(rs[k] - i);
    int dc = abs(cs[k] - j);
    if (dr % a != 0 || dc % b != 0) continue;
    dr /= a;
    dc /= b;
    if ((dr - dc) % 2 != 0) continue;
    res = min(res, max(dr, dc));
  }
  if ((res == 1000000000) || (res != 0 && (b >= m || n <= a))) res = 1000000000;
  if (res == 1000000000)
    cout << "Poor Inna and pony!";
  else
    cout << res;
  return 0;
}
