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.


-----Input-----

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


-----Output-----

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).


-----Examples-----
Input
aaaaa

Output
aaaaa

Input
aacaababc

Output
:(

Input
ababacacbbcc

Output
ababacac

Input
baba

Output
:(



-----Note-----

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".

Difficulty: interview

Starter code:

Solutions:
t = input()
z = t.count('a')
q = (len(t) - z) // 2
s = t[:q + z]
ss = t[q + z:]
p = ''.join([i for i in s if i != 'a'])
if p == ss:
    print(s)
else:
    print(':(')

a = input()
c = a.count('a')
new = a.replace('a', '')
k = len(new)
if k % 2 == 0 and new[:k//2] == new[k//2:] and a[:k//2+c].count('a') == c:
    print(a[:k//2+c])
else:
    print(":(")

s = input()
a = s.count('a')

l2 = (len(s)-a)//2
l1 = len(s)-l2

if s[:l1].replace('a','') == s[l1:]:
    print(s[:l1])
else:
    print(':(')




s=input()
l=len(s)
a=s.count("a")
if (l+a)%2==1:
    print(":(")
else:
    og=s[:(l+a)//2]
    newg=""
    for char in og:
        if char!="a":
            newg+=char
    if newg==s[(l+a)//2:]:
        print(og)
    else:
        print(":(")

from collections import Counter as C
s = input()
c = C(s)
n = len(s)
a = c.get('a', 0)
m = n - a
if m & 1:
    print(":(")
    return
m //= 2
m += a
t = s[:m]
if t + ''.join(c for c in t if c != 'a') != s:
    print(":(")
    return
print(t)

def main():
    s = input()
    a = ""
    for i in s:
        if i != 'a':
            a += i
    
    if len(a) & 1:
        print(":(")
        return 0
    
    n = len(a) >> 1
    A = a[:n]
    B = a[n:]
    if A != B:
        print(":(")
        return 0
    
    N = len(s)
    if s[N - n:] == A:
        print(s[:N - n])
        return 0
    else:
        print(":(")
        return 0

main()

s = input()
c = 0
for i in s :
    if i == 'a' :
        c=c+1
nb = len(s) - c
if nb%2 == 0 :
    nb=nb//2
    a = s[:nb+c]
    b = s[nb+c:]
    z = ""
    for i in a :
        if i !='a' :
            z=z+i
    if z == b :
        print(a)
    else :print(":(")
else:
    print(":(")

from collections import Counter

def func(s):
	res = []
	for c in s:
		if c != 'a':
			res.append(c)
	return ''.join(res)

s = input()
n = len(s)
c = Counter(list(s))
m = n - c['a']

if m % 2 != 0:
	print(':(')
else:
	t = s[:m//2 + c['a']]
	if func(t) == s[m//2 + c['a']:]:
		print(t)
	else:
		print(':(')


import sys

S=input()

L=len(S)


S2=""

for s in S:
    if s!="a":
        S2+=s

if len(S2)%2!=0:
    print(":(")
    return

L2=len(S2)//2

if L2==0:
    print(S)
    return

S3=S2[:L2]

if S[-L2:]==S3:
    print(S[:-L2])
    
else:
    print(":(")
    return

    


S = input()

a = S.count('a')
ls = (len(S) - a) // 2 + a

s1 = S[:ls]
s2 = S[ls:]

if (len(S) - a) % 2 != 0 or 'a' in s2:
    print(":(")
else:
    f = []
    for t in s1:
        if t != 'a':
            f += [t]
    if f != list(s2):
        print(":(")
    else:
        print(s1) 

from sys import stdin

s = stdin.readline().strip()
b = ''.join([c for c in s if c != 'a'])
if len(b) % 2 == 1:
    print(":(")
    # print(1)
elif b[:len(b) // 2] != b[len(b) // 2:]:
    print(":(")
    # print(2)
elif 'a' in s[len(s) - len(b) // 2:]:
    print(":(")
    # print(3)
else:
    print(s[:len(s) - len(b) // 2])



s = input()
wyn = 0
for i in s:
	if i == "a":
		wyn += 1
l = len(s)
import sys
if (l-wyn) % 2 != 0:
	print(":(")
	return
dl = (l - wyn) // 2 
pocz = s[:l-dl]
kon = s[l-dl:]
b = []
c= []
for i in pocz:
	if i != "a":
		b.append(i)
for i in kon:
	c.append(i)
if b == c:
	print(pocz)
else:
	print(":(")

s = input().strip()
a = s.count('a')
n = len(s)

l = (a+n)//2
word = s[:l]
gen = word + word.replace('a', '')

if gen == s:
    print(word)
else:
    print(":(")




s = input()
t = ''
for i in s:
    if i != 'a':
        t += i
if len(t) % 2:
    print(':(')
    return
q = t[:len(t)//2]
w = t[len(t)//2:]
if q != w:
    print(':(')
    return
cnt = 0
if len(q) != 0 and s[-len(q):] == q:
    print(s[:-len(q)])
elif len(q) == 0:
    print(s)
else:
    print(':(')

s = input()
s1 = ''
a = 0
for i in s:
    if i != 'a':
        s1 += i
    else:
        a += 1

if len(s1) % 2 != 0:
    print(':(')
else:
    s1 = s1[:len(s1) // 2]
    N = len(s)
    n = len(s1)
    if s[N - n:] == s1:
        print(s[:N - n])
    else:
        print(':(')


t = input()
n = len(t)
pref = [0] * n
pred = 0
for i in range(n):
	if t[i] == 'a':
		pref[i] += 1
	pref[i] += pred
	pred = pref[i]
for i in range(n):
	if pref[n - 1] - pref[i] == 0:
		if i - pref[i] + 1 == n - i - 1:
			f = True
			uk1 = 0
			uk2 = i + 1
			while uk2 < n:
				while t[uk1] == 'a':
					uk1 += 1
				if t[uk1] != t[uk2]:
					f = False
					break
				uk1 += 1
				uk2 += 1
			if f:
				for j in range(i + 1):
					print(t[j], end = '')
				return
print(":(")


s=input().strip()
su=0
for k in range(len(s)):
    if(s[k]=="a"):
        su+=1
mm=((len(s)-su)//2)+su
ss=s[:mm]
s1=""
for k in range(mm):
    if(s[k]!="a"):
        s1=s1+s[k]
sf=ss+s1
if(len(s)!=len(sf)):
    print(":(")
else:
 for k in range(len(s)):
     if(s[k]!=sf[k]):
         print(":(")
         break
 else:
     print(ss)

s = input()
string1 = ""
string2 = ""
flag = 0
n = len(s)
for i in range(n):
	string1+=s[i]
	if(s[i]!="a"):
		string2+=s[i]
	if(string1+string2)==s:
		flag = 1
		break
if(flag==0):
	print(":(")
else:
	print(string1)

s = input()

notA = 0

lis = []
for i in s:
    if i != 'a':
        notA += 1 
        lis.append(i)

if notA%2 == 1:
    print(":(")
else:
    check = 1
    for i in range(notA//2):
        if lis[i] != lis[notA//2 + i]:
            print(":(")
            check = 0
            break
    for i in range(len(s) - 1, len(s) - 1 - notA//2, -1):
        if s[i] == 'a':
            print(":(")
            check = 0
            break
    if check == 1:
        print(s[:len(s) - notA//2])

s = input()
nota = len(s) - s.count("a")
if nota % 2 != 0:
    print(":(")
else:
    if nota == 0:
        print(s)
    elif s[-nota//2:].count("a") > 0:
        print(":(")
    else:
        s1 = s.replace("a", "")
        if s1[:nota//2] != s1[nota//2:]:
            print(":(")
        else:
            print(s[:-nota//2])

from collections import Counter
s = input()
c = Counter(s)
l = (len(s) + c['a']) // 2
if s[:l].replace("a", "") == s[l:]:
    print(s[:l])
else:
    print(":(")

def astrip(s):
	return ''.join([char for char in s if char != 'a'])

def f(s):
	t = astrip(s)
	n = len(t)
	if n % 2 != 0:
		return ':('
	k = n // 2
	candidate = t[:-1*k]
	if t != candidate + candidate:
		return ':('
	if s[len(s)-k:] == candidate:
		return s[:len(s)-k]
	return ':('

print(f(input()))

t = input()

s = ""
for elem in t:
	if elem != "a":
		s += elem
if len(s) % 2 != 0:
	print(":(")
else:
	c = len(s) // 2
	if c == 0:
		print(t)
	elif s[:c] != s[c:]:
		print(":(")
	else:
		if t[-c:] != s[c:]:
			print(":(")
		else:
			print(t[:-c])

def solve():
    s = input()
    
    a = ""
    
    for x in s:
        if x != 'a':
            a += x
    
    if len(a) == 0:
        print (s)
        return
        
    n = len(a)//2
    
    if 'a' in s[len(s)-n:]:
        print (":(")
        return
    
    print (s[:len(s)-n] if a[:n] == a[n:] else ":(")    
    
def __starting_point():  
    solve()
__starting_point()

s=input()
l1=[]
for c in s:
    if c !='a':
        l1.append(c)
if len(l1)%2==0:
    flag=0
    
    for i in range(0,len(l1)//2):
        if l1[i]==l1[len(l1)//2+i]:
            continue
        else :
            flag=1
            break
    if flag==1:
        print(":(")
    else :
        flag=0
        for c in s[len(s)-len(l1)//2:]:
            if c=='a':
                flag=1
                break
        if flag==0:
            
            print(s[:len(s)-len(l1)//2])
        else :
            print(":(")
else :
    print(":(")