s = input('Фраза: ').split() if len(s) < 5 and s[-1].endswith('!'): print('Элементарно!') else: print('Нужно подумать еще')