#include <bits/stdc++.h>
using namespace std;
int fun(int a) {
  if (a > 0) return a;
  return -a;
}
int min(int a, int b) {
  if (a > b) return b;
  return a;
}
int main() {
  int n, m, i, j, a, b;
  while (scanf("%d%d%d%d%d%d", &n, &m, &i, &j, &a, &b) != EOF) {
    if ((i == 1 && j == 1) || (i == n && j == 1) || (i == n && j == m) ||
        (i == 1 && j == m)) {
      printf("0\n");
      continue;
    }
    if (((n - i) / a == 0 && (i - 1) / a == 0) ||
        ((m - j) / b == 0 && (j - 1) / b == 0)) {
      printf("Poor Inna and pony!\n");
      continue;
    }
    int ans = 100000000;
    if ((n - i) % a == 0 && (m - j) % b == 0) {
      int tx = (n - i) / a;
      int ty = (m - j) / b;
      if (tx == ty)
        ans = min(ans, tx);
      else {
        if (fun(tx - ty) % 2 == 0) ans = min(ans, tx > ty ? tx : ty);
      }
    }
    if ((i - 1) % a == 0 && (m - j) % b == 0) {
      int tx = (i - 1) / a;
      int ty = (m - j) / b;
      if (tx == ty)
        ans = min(ans, tx);
      else {
        if (fun(tx - ty) % 2 == 0) ans = min(ans, tx > ty ? tx : ty);
      }
    }
    if ((i - 1) % a == 0 && (j - 1) % b == 0) {
      int tx = (i - 1) / a;
      int ty = (j - 1) / b;
      if (tx == ty)
        ans = min(ans, tx);
      else {
        if (fun(tx - ty) % 2 == 0) ans = min(ans, tx > ty ? tx : ty);
      }
    }
    if ((n - i) % a == 0 && (j - 1) % b == 0) {
      int tx = (n - i) / a;
      int ty = (j - 1) / b;
      if (tx == ty)
        ans = min(ans, tx);
      else {
        if (fun(tx - ty) % 2 == 0) ans = min(ans, tx > ty ? tx : ty);
      }
    }
    if (ans == 100000000)
      printf("Poor Inna and pony!\n");
    else
      printf("%d\n", ans);
  }
  return 0;
}
