Hate "A"

题意翻译

## 题目描述 $Bob$ 无聊时写下了一个由一串小写字母组成的字符串 $s$ ,写完后他突发奇想,又写下了一个字符串 $s^{'}$ ,$s^{'}$ 是 $s$ 去掉所有小写字母“a”后剩余字母组成的字符串。然后他把 $s$ 和 $s^{'}$ 顺次拼接在一起,组成一个新的字符串 $t$ 。 写下 $t$ 后,$Bob$ 看你这么优秀,会打程序,就想为难一下你。现在他只告诉你他写下的字符串 $t$ ,你需要写一个程序,找出他写下的 $s$ 。 ## 输入输出格式 ### 输入格式 一行,由小写字母组成的字符串 $t$ ( $1\leq|t|\leq10^{5}$ ) 。 ### 输出格式 一行字符串,即 $Bob$ 写下的字符串 $s$ ( 数据保证 $s$ 是唯一的 ) 。如果你实在找不到符合条件的 $s$ ,那就输出 “:(” 吧。 ## 说明 - 第一个样例,$s=$ "aaaaa" ,$s^{'}$ 是空串。 - 第二个样例,找不到满足 $t$ 的 $s$ 。 - 第三个样例,$s=$ "ababacac" ,$s^{'}=$ "bbcc" ,$t=s+s^{'}=$ "ababacacbbcc" 。

题目描述

Bob has a string $ s $ consisting of lowercase English letters. He defines $ s' $ to be the string after removing all "a" characters from $ s $ (keeping all other characters in the same order). He then generates a new string $ t $ by concatenating $ s $ and $ s' $ . In other words, $ t=s+s' $ (look at notes for an example). You are given a string $ t $ . Your task is to find some $ s $ that Bob could have used to generate $ t $ . It can be shown that if an answer exists, it will be unique.

输入输出格式

输入格式


The first line of input contains a string $ t $ ( $ 1 \leq |t| \leq 10^5 $ ) consisting of lowercase English letters.

输出格式


Print a string $ s $ that could have generated $ t $ . It can be shown if an answer exists, it is unique. If no string exists, print ":(" (without double quotes, there is no space between the characters).

输入输出样例

输入样例 #1

aaaaa

输出样例 #1

aaaaa

输入样例 #2

aacaababc

输出样例 #2

:(

输入样例 #3

ababacacbbcc

输出样例 #3

ababacac

输入样例 #4

baba

输出样例 #4

:(

说明

In the first example, we have $ s = $ "aaaaa", and $ s' = $ "". In the second example, no such $ s $ can work that will generate the given $ t $ . In the third example, we have $ s = $ "ababacac", and $ s' = $ "bbcc", and $ t = s + s' = $ "ababacacbbcc".