#include <bits/stdc++.h>
int n, a, b;
int f[44444][33];
bool g[44444][33];
int In() {
  register int c, f, s;
  for (; c = getchar(), c != '-' && !isdigit(c);)
    ;
  for (s = (f = c == '-') ? 0 : c - '0'; c = getchar(), isdigit(c);)
    s = s * 10 + c - '0';
  return f ? -s : s;
}
bool ck(register int a, register int b) {
  register int s = 1;
  for (;;) {
    if (b & 1) {
      if (1ll * s * a > 1000000000) return 0;
      s *= a;
    }
    b >>= 1;
    if (!b) break;
    if (1ll * a * a > 1000000000) return 0;
    a *= a;
  }
  return s <= n;
}
bool sg(register int x, register int y) {
  if (g[x][y]) return f[x][y];
  g[x][y] = 1;
  if (!ck(x, y + 1)) {
    register int l = x, r = n;
    for (register int m; m = (l + r + 1) >> 1, l < r;
         ck(m, y) ? l = m : r = m - 1)
      ;
    return f[x][y] = (l - x) & 1;
  }
  if (!ck(x + 1, y)) {
    if (x == 1) {
      puts("Missing");
      exit(0);
    }
    return f[x][y] = !sg(x, y + 1);
  }
  return f[x][y] = !sg(x + 1, y) || !sg(x, y + 1);
}
int main() {
  a = In(), b = In(), n = In() - 1, puts(sg(a, b) ? "Masha" : "Stas");
  return 0;
}
