#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5, INF = 0x3f3f3f3f, mod = 1e9 + 7;
int dx[4], dy[4];
int main() {
  int n, m, i, j, a, b;
  cin >> n >> m >> i >> j >> a >> b;
  dx[0] = 1, dy[0] = 1, dx[1] = 1, dy[1] = m, dx[2] = n, dy[2] = 1, dx[3] = n,
  dy[3] = m;
  int ans = mod;
  for (int k = 0; k < 4; k++) {
    int x = abs(i - dx[k]);
    int y = abs(j - dy[k]);
    if ((x % a == 0) && (y % b == 0)) {
      if (x == 0 && y == 0) ans = 0;
      if (((x / a) & 1) ^ ((y / b) & 1)) continue;
      if (((x / a) & 1) == 0) {
        if (n - i < a && i - 1 < a) continue;
        if (m - j < b && j - 1 < b) continue;
      }
      ans = min(ans, max(abs(x / a), abs(y / b)));
    }
  }
  if (ans < mod)
    cout << ans << endl;
  else
    puts("Poor Inna and pony!");
}
