#include <bits/stdc++.h>
using namespace std;
bool check(int x1, int y1, int x2, int y2, int x3, int y3) {
  int a = pow(x1 - x2, 2) + pow(y1 - y2, 2);
  int b = pow(x2 - x3, 2) + pow(y2 - y3, 2);
  int c = pow(x1 - x3, 2) + pow(y1 - y3, 2);
  if ((a == b + c && a != 0 && b != 0 && c != 0) ||
      (b == a + c && a != 0 && b != 0 && c != 0) ||
      (c == a + b && a != 0 && b != 0 && c != 0)) {
    return true;
  }
  return false;
}
int main() {
  int n, m, i, j, a, b, mx;
  mx = 1e9;
  cin >> n >> m >> i >> j >> a >> b;
  int bx[] = {1, n, n, 1};
  int by[] = {m, 1, m, 1};
  for (int t = 0; t < 4; t++) {
    if (abs(bx[t] - i) % a == 0 && abs(by[t] - j) % b == 0) {
      int l = abs(bx[t] - i) / a;
      int r = abs(by[t] - j) / b;
      if ((l - r) % 2 == 0) {
        mx = min(max(l, r), mx);
      }
    }
  }
  if (mx == 1e9 || mx != 0 && (n <= a || m <= b)) {
    cout << "Poor Inna and pony!";
  } else
    cout << mx;
  return 0;
}
