#!/usr/bin/env python3

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

i = 0
buy = False
while True:
    if input() == "end":
        break
    i += 1
    if b + c * i < a * i:
        if buy:
            print("self")
        else:
            buy = True
            print("buy")
    else:
        print("airline")
