#include <bits/stdc++.h>
int calc_moves(int, int, int, int, int, int);
int min(int, int);
int main() {
  int i, j, x, y, n, m, a, b;
  scanf("%d %d %d %d %d %d", &n, &m, &x, &y, &a, &b);
  int sol1 = calc_moves(x, y, 1, 1, a, b);
  int sol2 = calc_moves(x, y, 1, m, a, b);
  int sol3 = calc_moves(x, y, n, 1, a, b);
  int sol4 = calc_moves(x, y, n, m, a, b);
  if (sol1 == -1 && sol2 == -1 && sol3 == -1 && sol4 == -1) {
    printf("Poor Inna and pony!\n");
  } else {
    int sol = min(sol1, min(sol2, min(sol3, sol4)));
    if (sol > 0 && ((x - a < 1 && x + a > n) || (y - b < 1 && y + b > m))) {
      printf("Poor Inna and pony!\n");
    } else {
      printf("%d\n", sol);
    }
  }
  return 0;
}
int calc_moves(int start_x, int start_y, int finish_x, int finish_y, int step_x,
               int step_y) {
  int dx = abs(start_x - finish_x);
  int dy = abs(start_y - finish_y);
  if (dx % step_x != 0 || dy % step_y != 0) {
    return -1;
  }
  int sx = dx / step_x;
  int sy = dy / step_y;
  if (abs(sx - sy) & 1) {
    return -1;
  } else {
    return (sx > sy) ? sx : sy;
  }
}
int min(int a, int b) {
  if (a == -1 || b == -1) {
    return -a * b;
  } else {
    return (a > b) ? b : a;
  }
}
