#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
string s;
char pre[110][110];
long long n, pw[maxn];
long long dp[110][110];
int main() {
  cin >> n >> s;
  pw[0] = 1;
  for (int i = 1; i <= 17; i++) {
    pw[i] = pw[i - 1] * 10;
  }
  reverse(s.begin(), s.end());
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= n; j++) {
      if (dp[i][j] + pw[i] * (s[i + j] - '0') >= dp[i + 1][j]) {
        dp[i + 1][j] = dp[i][j] + pw[i] * (s[i + j] - '0');
        pre[i + 1][j] = 'H';
      }
      if (dp[i][j] + pw[j] * (s[i + j] - '0') >= dp[i][j + 1]) {
        dp[i][j + 1] = dp[i][j] + pw[j] * (s[i + j] - '0');
        pre[i][j + 1] = 'M';
      }
    }
  }
  int x = n, y = n;
  while (x || y) {
    if (pre[x][y] == 'H') {
      cout << "H";
      x--;
    } else {
      cout << "M";
      y--;
    }
  }
  return 0;
}
