while True:
    stop = input().strip()
    if stop == "# 0 0":
        break
    name, age, weight = stop.split()
    age = int(age)
    weight = int(weight)
    if age > 17 or weight >= 80:
        result = "Senior"
    else:
        result = "Junior"
    print(name, result)