func_code_string: #include <bits/stdc++.h>   using namespace std;   inline bool SR(int &x) { return scanf( %d , &x) == 1; }   inline bool SR(long long &x) { return scanf( %lld , &x) == 1; }   inline bool SR(double &x) { return scanf( %lf , &x); }   inline bool SR(char *s) { return scanf( %s , s); }   inline bool RI() { return 1; }   template <typename I, typename... T>   bool RI(I &x, T &...tail) {     return SR(x) && RI(tail...);   }   inline void SP(const int x) { printf( %d , x); }   inline void SP(const long long x) { printf( %lld , x); }   inline void SP(const double x) { printf( %.10f , x); }   inline void SP(const char *s) { printf( %s , s); }   inline void PL() { puts(  ); }   template <typename I, typename... T>   void PL(const I x, const T... tail) {     SP(x);     if (sizeof...(tail)) putchar(   );     PL(tail...);   }   template <typename I>   inline void _DOING(const char *s, I &&x) {     cerr << s <<   =   << x <<   n ;   }   template <typename I, typename... T>   void _DOING(const char *s, I &&x, T &&...tail) {     int c = 0;     while (*s !=  ,  || c != 0) {       if (*s ==  (  || *s ==  [  || *s ==  { ) c++;       if (*s ==  )  || *s ==  ]  || *s ==  } ) c--;       cerr << *s++;     }     cerr <<   =   << x <<   ,  ;     _DOING(s + 1, tail...);   }   const int INF = 0x3f3f3f3f;   const long long INF64 = 0x3f3f3f3f3f3f3f3fll;   inline int RAND() {     static int x = 880301;     return x = (x * 0xdefacedll + 1ll) % 0x7fffffffll;   }   int n;   map<pair<int, int>, int> rd;   inline bool check(long long a, int b) {     long long x = 1;     while (b) {       if (a >= n) return 0;       if (b & 1) x = x * a;       if (x >= n) return 0;       a = a * a;       b >>= 1;     }     return 1;   }   int dfs(int a, int b) {     if (rd.count(make_pair(a, b))) return rd[make_pair(a, b)];     if (!check(a, b)) return rd[make_pair(a, b)] = 1;     if (a == 1) {       if (!check(a + 1, b))         return rd[make_pair(a, b)] = 0;       else if (dfs(a + 1, b) == -1 || dfs(a, b + 1) == -1)         return rd[make_pair(a, b)] = 1;       else if (dfs(a + 1, b) == 0 || dfs(a, b + 1) == 0)         return rd[make_pair(a, b)] = 0;       else         return rd[make_pair(a, b)] = -1;     } else if (b == 1) {       if (1ll * a * a >= n) {         if ((n - a) & 1)           return rd[make_pair(a, b)] = -1;         else           return rd[make_pair(a, b)] = 1;       } else if (dfs(a + 1, b) == -1 || dfs(a, b + 1) == -1)         return rd[make_pair(a, b)] = 1;       else if (dfs(a + 1, b) == 0 || dfs(a, b + 1) == 0)         return rd[make_pair(a, b)] = 0;       else         return rd[make_pair(a, b)] = -1;     } else {       if (dfs(a + 1, b) == -1 || dfs(a, b + 1) == -1)         return rd[make_pair(a, b)] = 1;       else         return rd[make_pair(a, b)] = -1;     }   }   int main() {     int a, b;     RI(a, b, n);     int res = dfs(a, b);     if (res == 1)       PL( Masha );     else if (res == -1)       PL( Stas );     else       PL( Missing );     return 0;   }   