# Arup Guha
# 3/16/2026
# Solution to 2026 UCF HS Contest Problem E: Pirates on a Boat

# Returns true iff pirate is in the rectangle defined by botLeft and topRight.
def inboat(botLeft, topRight, pirate):

    # Go through x and y. Return false if not in range.
    for i in range(len(botLeft)):
        if pirate[i] < botLeft[i] or pirate[i] > topRight[i]:
            return False

    # Good if we get here.
    return True
    
# Get both lower left and upper right coordinates.
vals = [int(x) for x in input().split()]
botLeft = vals[:2]
topRight = vals[2:]

# Get number of pirates.
n = int(input())
ok = True

# Just go through all.
for i in range(n):

    # Get this pirate.
    pirate = [int(x) for x in input().split()]

    # If this guy's not on the boat, we can't do it.
    if not inboat(botLeft, topRight, pirate):
        ok = False

# Output accordingly.
if ok:
    print("A boat full of pirates!")
else:
    print("Pirate overboard!")

        
