One day Dima and Alex had an argument about the price and quality of laptops. Dima thinks that the more expensive a laptop is, the better it is. Alex disagrees. Alex thinks that there are two laptops, such that the price of the first laptop is less (strictly smaller) than the price of the second laptop but the quality of the first laptop is higher (strictly greater) than the quality of the second laptop.

Please, check the guess of Alex. You are given descriptions of n laptops. Determine whether two described above laptops exist.


-----Input-----

The first line contains an integer n (1 ≤ n ≤ 10^5) — the number of laptops.

Next n lines contain two integers each, a_{i} and b_{i} (1 ≤ a_{i}, b_{i} ≤ n), where a_{i} is the price of the i-th laptop, and b_{i} is the number that represents the quality of the i-th laptop (the larger the number is, the higher is the quality).

All a_{i} are distinct. All b_{i} are distinct. 


-----Output-----

If Alex is correct, print "Happy Alex", otherwise print "Poor Alex" (without the quotes).


-----Examples-----
Input
2
1 2
2 1

Output
Happy Alex

Difficulty: interview

Starter code:

Solutions:
n = int(input())
arr = []
for i in range(n):
	a,b = map(int, input().split(' '))
	arr.append((a,b))
arr = sorted(arr)
for i in range(n-1):
	if(arr[i][1]>arr[i+1][1]):
		print("Happy Alex")
		break
else:
	print("Poor Alex")

__author__ = 'nikolay'
n = int(input())
a = []
for i in range(n):
    a.append(tuple(map(int, input().split())))
a.sort()
for i in range(1, n):
    if a[i][1] < a[i-1][1]:
        print("Happy Alex")
        break
else:
    print("Poor Alex")


N = int(input())
stuff = []
for n in range(N):
	l = list(map(int, input().split()))
	stuff.append([l[1],l[0]])
stuff.sort()
lp = -1
happy = False
for s in stuff:
	if s[1] < lp:
		happy = True
		break
	lp = s[1]
print("Happy Alex" if happy else "Poor Alex")


pops=int(input())
sa=[[0, 0] for t in range(pops)]
for t in range(pops):
    a, b=list(map(int, input().split(' ')))
    sa[t][0]=a
    sa[t][1]=b

sa.sort()

sa2=[sa[x][1] for x in range(len(sa))]

sa3=sa2[:]
sa2.sort()

if sa3!=sa2:
    print("Happy Alex")
else:
    print("Poor Alex")


n = int(input())
c = [[]] * n
for i in range(n):
    c[i] = [int(j) for j in input().split()]
c.sort()
for i in range(n - 1):
    if c[i][0] < c[i + 1][0] and c[i][1] > c[i + 1][1]:
        print('Happy Alex')
        return
print('Poor Alex')


i=int(input())
l=[None]*i
y=0
while y<i:
    l[y]=[int(x) for x in input().split()]
    y+=1
l1=sorted(l,key=lambda x: x[0])
l2=sorted(l,key=lambda x: x[1])
if(l1!=l2):
    print("Happy Alex")
else:
    print("Poor Alex")

n = int(input())
c = []
for i in range(n):
    c.append([int(i) for i in input().split()])
c = sorted(c)
import sys
for i in range(len(c)-1):
    if c[i][1] > c[i+1][1]:
        print("Happy Alex")
        return
print("Poor Alex")


lst = list(map(int, input().split()))
n=lst[0]
price=[]
quality=[]
data={};
for i in range(0,n):
    x = list(map(int, input().split()))
    data[x[0]]=x[1]
last=-1;
for key in sorted(data):
    if last>data[key]:
        print('Happy Alex')
        return
    last=data[key]
print('Poor Alex') 



n=int(input())
a=[]
for i in range(n):
    a.append(list(map(int,input().split())))
a.sort()
for i in range(n-1):
    if a[i+1][1]<a[i][1]:
        print('Happy Alex')
        return
print('Poor Alex')

n=int(input())

m=list()
for i in range (n):
    m.append(list(int(x) for x in input().split()))
m.sort();

k=0 
for i in range(n-1):
    if m[i][1]>m[i+1][1]:
            print("Happy Alex") 
            k=1
            break
    if k:
        break
if not k:
    print("Poor Alex")


n = int(input())
l = []

for x in range(n):
  m = input().split()
  a = (int(m[0]), int(m[1]))
  l.append(a)

l = sorted(l)
h = 0

for x in range(n-1):
    if l[x][0] < l[x+1][0] and l[x][1] > l[x+1][1]:
        h = 1
        
if h == 1:
    print("Happy Alex")

else:
    print("Poor Alex")

n = int(input())
lst = [list(map(int,input().split())) for i in range(n)]
lst.sort()
is_happy = False
for i in range(1, n):
    if lst[i][0] > lst[i - 1][0] and lst[i - 1][1] > lst[i][1]:
        is_happy = True
if is_happy:
    print("Happy Alex")
else:
    print("Poor Alex")

N = int(input())

laptops = []

for i in range(N):
    string = input()
    string.strip()
    string += " "
    current = []
    current_st = ""
    for char in string:
        if char != " ":
            current_st += char
        else:
            current.append(int(current_st))
            current_st = ""
    laptops.append(current)

laptops.sort()

#print(laptops)

isReverse = False

for i in range(N-1):
    if laptops[i+1][1] < laptops[i][1]:
        isReverse = True
        print("Happy Alex")
        break

if isReverse == False:
    print("Poor Alex")


n = int(input())
if n == 1:
    (a, b) = list(map(int, input().split()))
    print("Poor Alex")
else:
    x = [0] * n
    for i in range(n):
        x[i] = [0] * 2
        (x[i][0], x[i][1]) = list(map(int, input().split()))
    x.sort()
    ans = False
    for i in range(1, n):
        if x[i][1] < x[i-1][1]:
            ans = True
            break
    if ans == True:
        print("Happy Alex")
    else:
        print("Poor Alex")


#!/usr/bin/env python3


def is_sorted(l, f):
    return all(f(a, b) for a, b in zip(l[:-1], l[1:]))

def main():
    n = int(input())

    lst = map(lambda _: input(), range(n))
    lst = map(lambda s: tuple(map(int, s.split())), lst)
    lst = sorted(lst)

    if is_sorted(lst, lambda a, b: a[1] <= b[1]):
        print("Poor Alex")
    else:
        print("Happy Alex")

def __starting_point():
    main()
__starting_point()

import sys
n = int(input())
v = []
for i in range(n):
    v.append(list(map(int, input().split())))
v.sort()
for i in range(n-1):
    if v[i+1][1] < v[i][1]:
        print('Happy Alex')
        return
print('Poor Alex')

n = int(input())
ok = 0
for i in range(n):
    a,b = list(map(int,input().split()))
    if a==b: ok = ok + 1
if ok == n : print("Poor Alex")
else:
    print("Happy Alex")


n = int(input())
a = sorted(tuple(map(int, input().split())) for _ in range(n))
b = [x[1] for x in a]
for i in range(n - 1, 0, -1):
  b[i - 1] = min(b[i - 1], b[i])
for i in range(n - 1):
  if a[i][1] > b[i + 1]:
    print("Happy Alex")
    return
print("Poor Alex")

n = int(input())
t = sorted(tuple(map(int, input().split())) for i in range(n))
print('Happy Alex' if any(t[i + 1][1] < t[i][1] for i in range(n - 1)) else 'Poor Alex')

from operator import itemgetter


def main():
    total_num = int(input())
    laptops = []
    for i in range(total_num):
        laptops.append([int(i) for i in input().split()])
    laptops = sorted(laptops, key=itemgetter(0))
    res = all(laptops[i][1] <= laptops[i + 1][1] for i in range(len(laptops) - 1))
    if res:
        print("Poor Alex")
    else:
        print("Happy Alex")


def __starting_point():
    main()
__starting_point()

n = int(input())
m=list()

for i in range(n):
    m.append(list(int(x) for x in input().split()))
    
m.sort()
ok=1
for i in range(n-1):
      if m[i][1]>m[i+1][1]:
          print("Happy Alex")
          ok=0
          break
        
if ok==1:
    print("Poor Alex")
          


n = int(input())
k = 0
for i in range(n):
    a,b = map(int,input().split())
    if a != b:
        k = 1
if k == 0:
    print('Poor Alex')
else:
    print('Happy Alex')


def laptops():
    _n = input()
    n = int(_n)
    l = []
    for i in range(n):
        _x, _y = input().split()
        x = int(_x)
        y = int(_y)
        p = (x, y)
        l.append(p)
    l.sort(key=lambda x: x[0])
    for i in range(n-1):
        if l[i][1] > l[i+1][1]:
            print("Happy Alex")
            return
    print("Poor Alex")

laptops()