#! /usr/bin/env python3 import sys n = int(input()) s = input() c = 0 x = {'hand':150, 'lily':2000, 'factory':30000, 'casino':600000, 'grimoire':10000000} a = {'hand':1, 'lily':10, 'factory':120, 'casino':2000, 'grimoire':25000} b = {'hand':150, 'lily':2000, 'factory':30000, 'casino':600000, 'grimoire':10000000} d = {'hand':1, 'lily':0, 'factory':0, 'casino':0, 'grimoire':0} r = {'hand':1, 'lily':1, 'factory':1, 'casino':1, 'grimoire':1} for i in range(n): print(c, d, file=sys.stderr) f=0 cmd = '' if cmd == '' and i >= n - 4 and d['casino'] > 0: cmd = 'sell casino' if cmd == '' and i >= n - 2 and d['grimoire'] > 0: cmd = 'sell grimoire' if cmd == '': for k in b: if k == 'hand' and c > 15*a[k] and d[k] <= a[k] * 10 and r[k]: cmd += 'enhclick' c -= 15*a[k] a[k] *= 2 d[k] *= 2 r[k] = 0 break elif c > b[k]*10 and a[k] * 5 < d[k] <= a[k] * 10 and r[k]: if b[k] >= 10000000 and i > n-200 : continue cmd += 'reinforce ' + k c -= b[k] a[k] *= 2 d[k] *= 2 r[k] = 0 break if cmd == '': for k in b: if c > b[k] and d[k] < a[k] * 10: if b[k] >= 10000000 and i > n-200 : continue cmd += 'buy ' + k c -= b[k] b[k] = int(1.2 * b[k]) d[k] += a[k] break if cmd == '' : cmd = 'click' f=1 print(cmd) for i, j in d.items(): if i == 'hand' and f: c += j else: c += j s = input()