#include <bits/stdc++.h>
using namespace std;
int n, m, a, b, x, y;
const int inf = 1e7;
int solve(int tx, int ty) {
  int dx = abs(x - tx);
  int dy = abs(y - ty);
  if (dx % a || dy % b) return inf;
  dx /= a;
  dy /= b;
  if (dx % 2 != dy % 2) return inf;
  if (dy && x + a > n && x - a <= 0) return inf;
  if (dx && y + b > m && y - b <= 0) return inf;
  return max(dx, dy);
}
int main() {
  cin >> n >> m >> x >> y >> a >> b;
  int ans = min(min(solve(1, 1), solve(1, m)), min(solve(n, m), solve(n, 1)));
  if (ans == inf)
    cout << "Poor Inna and pony!";
  else
    cout << ans << endl;
}
