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).
INF = float('inf')  #ret INF means can not reach that corner 
def solve(i, j, n, m, a, b):
    # i and j are distances from end rows, end columns
    #print('dist from r', i,'dist from c', j)
    ret = 0
    if i % a != 0 or j % b != 0:  #if distance is not dividible by step size
        return INF                #i.e no of steps is not an integer, cant reach that corner
    ret = min(i // a, j // b)     #if both distances are divisble, number of full steps that  
    #print('steps r c',ret, i//a, j//b) #can be taken towards that corner is the minimum of them
    i -= ret * a              
    j -= ret * b    #after taking these full steps calculate the new distances from the corner 
    #print('dist after full steps',i,j)
    #print('--------')

    if i != 0 and j != 0: #if both distances are not equal to zero,    
        #print(1)          #i.e didnot reach end row or col, cant reach that corner 
        return INF
    if j // b % 2 != 0 or i // a % 2 != 0: #if the remaining no of steps needed in either  
        #print(2)                  #directions is not even, cant reach that corner
        return INF
    if i == 0 and j != 0 and a >= n: #if reached end row but not end column 
        #print(3)          #and step size through rows is bigger than no_of rows 
        return INF        #cant reach that corner 
    if j == 0 and i != 0 and b >= m: #if reached end col but not end row
        #print(4)          #and step size through cols is bigger than no_of cols
        return INF        #cant reach that corner
    #print(5)
    return ret + j // b + i // a #return full steps + remaining steps c + remaining steps r


n, m, i, j, a, b = map(int, input().split())
x = min(solve(i-1, j-1, n, m, a, b), solve(n-i, j-1, n, m, a, b),
        solve(i-1, m-j, n, m, a, b), solve(n-i, m-j, n, m, a, b))
if x < INF:
  print(x)
else:
  print("Poor Inna and pony!")