#! /usr/bin/env python3 import sys n = int(input()) s = input() c = 0 x = {'hand':15, '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':0, 'lily':1, 'factory':1, 'casino':1, 'grimoire':1} g = {'hand':12, 'lily':9, 'factory':9, 'casino':9, 'grimoire':9} 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 > x[k] * (10 ** r[k]) and r[k]<4: cmd += 'enhclick' c -= x[k] * (10 ** r[k]) a[k] *= 2 d[k] *= 2 r[k] += 1 break elif c > b[k] * (10 ** r[k]) and r[k]<3: cmd += 'reinforce ' + k c -= x[k] * (10 ** r[k]) a[k] *= 2 d[k] *= 2 r[k] += 1 break if cmd == '': for k in b: if c > b[k] and d[k] < a[k] * g[k]: 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()