#include <bits/stdc++.h>
using namespace std;
int N, M, I, J, A, B, final = 0x7fffffff;
bool ok1, ok2;
void Myfind(int x, int y) {
  int tmp = 1000000;
  if (x >= y && (x == 0 || ok2)) tmp = x;
  if (x <= y && (y == 0 || ok1)) tmp = y;
  if (tmp == 1000000) return;
  final = min(final, tmp);
}
void solve() {
  scanf("%d%d%d%d%d%d", &N, &M, &I, &J, &A, &B);
  int a = N - I, b = I - 1, c = M - J, d = J - 1;
  if (I - A >= 1 || I + A <= N) ok1 = 1;
  if (J - B >= 1 || J + B <= M) ok2 = 1;
  if (a % A == 0 && c % B == 0 && (a / A + c / B) % 2 == 0) {
    Myfind(a / A, c / B);
  }
  if (b % A == 0 && c % B == 0 && (b / A + c / B) % 2 == 0) {
    Myfind(b / A, c / B);
  }
  if (a % A == 0 && d % B == 0 && (a / A + d / B) % 2 == 0) {
    Myfind(a / A, d / B);
  }
  if (b % A == 0 && d % B == 0 && (b / A + d / B) % 2 == 0) {
    Myfind(b / A, d / B);
  }
  if (final == 0x7fffffff) {
    printf("Poor Inna and pony!\n");
    return;
  }
  printf("%d\n", final);
}
int main() {
  solve();
  return 0;
}
