#include <bits/stdc++.h>
using namespace std;
using namespace std;
const int N = 35000;
const int M = 31;
int a, b, n, dp[N][M];
bool check(int a, int b, int n) {
  long long ret = 1LL;
  for (int i = 0; i < b; i++) {
    ret = ret * a;
    if (ret <= 0 || ret >= n) return true;
  }
  return false;
}
int dfs(int a, int b) {
  if (dp[a][b] != -1) return dp[a][b];
  if (check(a, b, n)) {
    return dp[a][b] = 1;
  }
  int ret = 0;
  ret |= !dfs(a + 1, b);
  ret |= !dfs(a, b + 1);
  return dp[a][b] = ret;
}
bool b_is_one(int a, int b = 1) {
  int up = sqrt(n - 0.0000001);
  int turn = 0;
  while (a <= up) {
    if (dp[a][b + 1] == 0) {
      return turn == 0;
    }
    a++;
    turn = 1 - turn;
  }
  int remain = n - 1 - a;
  turn = (turn + remain) % 2;
  return turn;
}
int a_is_one(int b, int a = 1) {
  if (check(a, b, n))
    return 0;
  else {
    int turn = 0;
    for (; !check(2, b, n); b++) {
      if (dp[a + 1][b] == 0) {
        if (turn == 0)
          return 1;
        else
          return -1;
      }
      turn = 1 - turn;
    }
    return 0;
  }
}
int main() {
  memset(dp, -1, sizeof(dp));
  cin >> a >> b >> n;
  if (check(a, b, n)) {
    puts("Masha");
    return 0;
  }
  for (int i = 2; i < N; i++) {
    for (int j = 2; j < M; j++) {
      dp[i][j] = dfs(i, j);
    }
  }
  if (a != 1 && b != 1) {
    puts(dp[a][b] ? "Masha" : "Stas");
    return 0;
  }
  if (a == 1 && b == 1) {
    int c = a_is_one(b + 1), d = b_is_one(a + 1);
    if (c < 0 || d == 0)
      puts("Masha");
    else if (c == 0)
      puts("Missing");
    else
      puts("Stas");
  } else if (b == 1) {
    puts(b_is_one(a) ? "Masha" : "Stas");
  } else if (a == 1) {
    int c = a_is_one(b);
    if (c == 0)
      puts("Missing");
    else if (c == 1)
      puts("Masha");
    else
      puts("Stas");
  }
  return 0;
}
