stos =[]
while True:
try:
operacja=input()
if operacja=='+':
if len(stos)>=10:
print(':(')
else:
print(':)')
stos.append(input())
elif operacja =='-':
if len(stos)>0:
print(stos[len(stos)-1])
stos.pop(len(stos)-1)
else:
print(':(')
except:
break
c3RvcyA9W10Kd2hpbGUgVHJ1ZToKCXRyeToKCQlvcGVyYWNqYT1pbnB1dCgpCgkJaWYgb3BlcmFjamE9PScrJzoKCQkJaWYgbGVuKHN0b3MpPj0xMDoKCQkJCXByaW50KCc6KCcpCgkJCWVsc2U6CgkJCQlwcmludCgnOiknKQoJCQkJCgkJCQlzdG9zLmFwcGVuZChpbnB1dCgpKQoJCWVsaWYgb3BlcmFjamEgPT0nLSc6CgkJCWlmIGxlbihzdG9zKT4wOgoJCQkJcHJpbnQoc3Rvc1tsZW4oc3RvcyktMV0pCgkJCQlzdG9zLnBvcChsZW4oc3RvcyktMSkKCQkJZWxzZToKCQkJCXByaW50KCc6KCcpCglleGNlcHQ6CgkJYnJlYWsKCQ==