#include <bits/stdc++.h>   using namespace std;   const long long INF = 9e18L;   const long long mod = 1e9 + 7;   long long power(long long x, long long y) {     long long res = 1;     int mod = 1e9 + 7;     while (y > 0) {       if (y & 1) (res = res * x) %= mod;       (x = x * x) %= mod;       y = y >> 1;     }     return res;   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     string s;     cin >> s;     long long n = s.size();     if (n <= 2) {       cout << s <<   n ;       return 0;     }     int cnt = 1;     vector<pair<char, long long>> v;     for (int i = 1; i < n; i++) {       if (s[i] == s[i - 1])         cnt++;       else {         v.push_back({s[i - 1], cnt});         cnt = 1;       }     }     v.push_back({s[n - 1], cnt});     int m = v.size();     for (int i = 1; i < m; i++) {       if (v[i].second >= 2 && v[i - 1].second >= 2) {         v[i].second = 1;         v[i - 1].second = 2;       }       if (v[i].second > 2) v[i].second = 2;     }     string res =   ;     for (auto x : v) {       long long k = min(x.second, 2LL);       while (k--) res += x.first;     }     cout << res <<   n ;   }   