Double or One Thing 1234567891011121314151617181920212223242526272829303132333435#include <bits/stdc++.h>using namespace std;string solve(string& s) { string res = ""; for(int i = 0; i < s.length() - 1; i++) { if(s[i] > s[i+1]) res.push_back(s[i]); else if(s[i] < s[i+1]) { res.push_back(s[i]); res.push_back(s[i]); } else if(s[i] == s[i+1]) { int find = 0; for(int j = i + 2; j < s.length() and find == 0; j++) { if(s[j] > s[i]) find = 1; else if(s[j] < s[i]) find = -1; } res.push_back(s[i]); if(find == 1) res.push_back(s[i]); } } return res + s.back();}int main() { int tc; cin>>tc; for(int i = 1; i <= tc; i++) { string s; cin>>s; cout<<"Case #"<<i<<": "<<solve(s)<<endl; } return 0;}