#!/usr/bin/python3

a, b, c = map(int, input().split())

owned = False
cost = 0

# assert a<(b+c)
trips = 1
while True:
    inp = input()
    if inp=='end':
        exit(0)
    if owned:
        print("self")
    elif trips*a>(b+c*trips):
        print("buy")
        owned = True
    else:
        print("airline")
    trips += 1
