#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
enum dir {
  DOWN = 0,
  UP,
  RIGHT,
  LEFT,
  DOWN_RIGHT,
  DOWN_LEFT,
  UP_RIGHT,
  UP_LEFT
};
int dir_r[] = {1, -1, 0, 0, 1, 1, -1, -1};
int dir_c[] = {0, 0, 1, -1, 1, -1, 1, -1};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, i, j, a, b;
  cin >> n >> m >> i >> j >> a >> b;
  pair<int, int> corners[4];
  corners[0] = {1, 1};
  corners[1] = {1, m};
  corners[2] = {n, 1};
  corners[3] = {n, m};
  int ans = 1e9;
  for (int id = 0; id < 4; id++) {
    int x = abs(corners[id].first - i);
    int y = abs(corners[id].second - j);
    if (x % a != 0 || y % b != 0) continue;
    x = x / a;
    y = y / b;
    if (((x & 1) && (y & 1)) || (x % 2 == 0 && y % 2 == 0)) {
      if ((x == 0 && (a + i <= n || i - a >= 1)) ||
          (y == 0 && (b + j <= m || j - b >= 1)) || (x == 0 && y == 0) ||
          (x != 0 && y != 0))
        ans = min(ans, max(x, y));
    }
  }
  if (ans == 1e9)
    cout << "Poor Inna and pony!";
  else
    cout << ans;
  return 0;
}
