Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an *n* × *m* chessboard, a very tasty candy and two numbers *a* and *b*.

Dima put the chessboard in front of Inna and placed the candy in position (*i*, *j*) on the board. The boy said he would give the candy if it reaches one of the corner cells of the board. He's got one more condition. There can only be actions of the following types:
 -  move the candy from position (*x*, *y*) on the board to position (*x* - *a*, *y* - *b*); -  move the candy from position (*x*, *y*) on the board to position (*x* + *a*, *y* - *b*); -  move the candy from position (*x*, *y*) on the board to position (*x* - *a*, *y* + *b*); -  move the candy from position (*x*, *y*) on the board to position (*x* + *a*, *y* + *b*). 
Naturally, Dima doesn't allow to move the candy beyond the chessboard borders.

Inna and the pony started shifting the candy around the board. They wonder what is the minimum number of allowed actions that they need to perform to move the candy from the initial position (*i*, *j*) to one of the chessboard corners. Help them cope with the task!
The first line of the input contains six integers *n*, *m*, *i*, *j*, *a*, *b* (1 ≤ *n*, *m* ≤ 10<sup class="upper-index">6</sup>; 1 ≤ *i* ≤ *n*; 1 ≤ *j* ≤ *m*; 1 ≤ *a*, *b* ≤ 10<sup class="upper-index">6</sup>).

You can assume that the chessboard rows are numbered from 1 to *n* from top to bottom and the columns are numbered from 1 to *m* from left to right. Position (*i*, *j*) in the statement is a chessboard cell on the intersection of the *i*-th row and the *j*-th column. You can consider that the corners are: (1, *m*), (*n*, 1), (*n*, *m*), (1, 1).
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect, insort
from time import perf_counter
from fractions import Fraction
import copy
from copy import deepcopy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def L(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]
try:
    # sys.setrecursionlimit(int(pow(10,6)))
    sys.stdin = open("input.txt", "r")
    # sys.stdout = open("output.txt", "w")
except:
    pass
def pmat(A):
    for ele in A: print(*ele,end="\n")


n,m,x,y,a,b = map(int,raw_input().split())
v = 1<<60
for c in [(1,m),(n,1),(n,m),(1,1)]:
  dx=abs(x - c[0])
  dy=abs(y - c[1])
  if 0==dx+dy:
    v=0
  elif dx%a==0 and dy%b==0 and (dx/a)%2==(dy/b)%2:
    v=min(v,max(dx/a,dy/b))
if v and (max(n-x,x-1)<a or max(m-y,y-1)<b):
  v=1<<60
print ("Poor Inna and pony!",v)[v<(1<<55)]



#endtime = time.time()
# print(f"Runtime of the program is {endtime - starttime}")
