-
Notifications
You must be signed in to change notification settings - Fork 0
/
1146B.cpp
61 lines (58 loc) · 1.49 KB
/
1146B.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// DATE: 29-03-2022
// TIME:20:53:36
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define dbl double
#define deb(v) cout << #v << " " << v << "\n"
#define foi(i, base, n, k) for (i = base; i < n; i += k)
#define fod(i, base, n, k) for (i = base; i >= n; i -= k)
#define vec(type1, name) vector<type1> name
#define vp(type1, type2, name) vector<pair<type1, type2>> name
#define st(type, name) set<type> name
#define mpp(type1, type2, name) map<type1, type2> name
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define all(x) x.begin(), x.end()
#define part(x, a, b) x.begin() + a, x.begin() + b
#define Pi 3.1415926535897932384626
void gaurish()
{
ll i, j, k;
string s;
cin >> s;
string temp = "";
for (auto x : s)
{
if (x != 'a')
temp = temp + x;
}
if (temp == "")
cout << s << "\n";
else if (temp.substr(0, (temp.size() / 2)) == temp.substr((temp.size() / 2), temp.size()))
{
if (s.substr((s.size() - temp.size() / 2), s.size()) == temp.substr(0, (temp.size() / 2)))
cout << s.substr(0, (s.size() - temp.size() / 2));
else
cout << ":(";
}
else
cout << ":(";
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
/*#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif*/
ll t = 1;
// cin >> t;
while (t--)
{
gaurish();
}
}