# Arup Guha
# 3/5/2022
# Solution to 2022 UCF HS Problem: Catching Those Zs!

# Get number of cases.
nC = int(input())

# Go through each case.
for loop in range(nC):

    # Get sentence in lower case.
    sentence = input().lower()

    # Add 1 for each z in the line.
    zCnt = 0
    for letter in sentence:
        if letter == 'z':
            zCnt+=1

    # Output appropriately.
    if zCnt >= 3:
        print("Time to take a nap.")
    else:
        print("Perry saves the day!")
