#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i bool chmin(T& a, T b){ if(a > b){a = b; return true;} return false; } template bool chmax(T& a, T b){ if(a < b){a = b; return true;} return false; } template T gcd(T a, T b){ return a % b ? gcd(b, a % b) : b; } template T lcm(T a, T b){ return a / gcd(a, b) * b; } vector> run_length(string s){ int n = s.size(); vector> res; char pre = s[0]; int cnt = 1; rep(i, 1, n){ if(s[i] == pre){ ++cnt; }else{ res.push_back({pre, cnt}); pre = s[i], cnt = 1; } } res.push_back({pre, cnt}); return res; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); string s; cin >> s; auto rle = run_length(s); for(auto [c, l] : rle) cout << c; cout << endl; return 0; }