fork download
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <iostream>
  3. #include <string>
  4. #include <vector>
  5. #include <cmath>
  6. #include <deque>
  7. #include <queue>
  8. #include <fstream>
  9. #include <iomanip>
  10. #include <stack>
  11. #include <algorithm>
  12. #include <set>
  13. #include <map>
  14. #include <list>
  15. #include <bitset>
  16. #define srt(v) sort(v.begin(),v.end())
  17. #define PI acos(-1)
  18. #define sz(k) (int)k.size()
  19. #define endl "\n"
  20. #define MaHmoud_RodrigueZ LANCER_SHARK();
  21. typedef long long ll;
  22. const int N = 1e9 + 7;
  23. using namespace std;
  24. ll gcd(ll x, ll y) { return (!y) ? x : gcd(y, x % y); }
  25. void LANCER_SHARK(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); }
  26.  
  27.  
  28. //vector<int>v(2e5 + 7);
  29. //bool DoIT(int mid, ll n, ll k){}
  30.  
  31. int frq[127];
  32. int main(){
  33. //freopen("fruits.in", "r", stdin);
  34. //freopen("output.txt", "w", stdout);
  35. MaHmoud_RodrigueZ;
  36. int c = 0;
  37. string str,s;
  38. string res[] = { "MaTb3aa", "Ezzat" };
  39. cin >> str;
  40. s = str;
  41. bool ok = true;
  42.  
  43. while (ok){
  44. ok = false;
  45. str = s;
  46. s = str[0];
  47. for (int i = 1; i < sz(str) - 1; i++){
  48. if (str[i - 1] != str[i + 1]){
  49. str[i] = str[i - 1];
  50. c = (c + 1) % 2;
  51. ok = true;
  52. }
  53. else
  54. s += str[i];
  55. }
  56. s += str[sz(str) - 1];
  57. }
  58. cout << res[c];
  59. cout << endl;
  60. return 0;
  61. }
Success #stdin #stdout 0.01s 5460KB
stdin
abacdege
stdout
MaTb3aa