#include <bits/stdc++.h>
using namespace std;
char s[50], ss[50];
long long dp[40][20];
int n, path[40][20][40];
long long power[20];
void solve() {
  int i, j, k;
  memset(dp, 0, sizeof(dp));
  memset(path, 0, sizeof(path));
  dp[1][1] = (s[1] - '0');
  path[1][1][1] = 1;
  dp[1][0] = (s[1] - '0');
  path[1][0][1] = 0;
  for (i = 1; i < 2 * n; i++) {
    for (j = max(i - n, 0); j <= min(i, n); j++) {
      if (j < n) {
        if (dp[i + 1][j + 1] <= dp[i][j] + (s[i + 1] - '0') * power[j]) {
          dp[i + 1][j + 1] = dp[i][j] + (s[i + 1] - '0') * power[j];
          for (k = 1; k <= i; k++) {
            path[i + 1][j + 1][k] = path[i][j][k];
          }
          path[i + 1][j + 1][i + 1] = 1;
        }
      }
      if (i + 1 - j <= n) {
        if (dp[i + 1][j] <= dp[i][j] + (s[i + 1] - '0') * power[i - j]) {
          dp[i + 1][j] = dp[i][j] + (s[i + 1] - '0') * power[i - j];
          for (k = 1; k <= i; k++) {
            path[i + 1][j][k] = path[i][j][k];
          }
          path[i + 1][j][i + 1] = 0;
        }
      }
    }
  }
}
int main() {
  int i, j;
  power[0] = 1;
  for (i = 1; i <= 18; i++) power[i] = power[i - 1] * 10;
  while (scanf("%d", &n) != EOF) {
    scanf("%s", ss);
    int len = strlen(ss);
    if (len == 2) {
      printf("HM\n");
      continue;
    }
    for (i = 0; i < len; i++) s[len - i] = ss[i];
    s[len + 1] = '0';
    solve();
    for (i = n * 2; i > 0; i--) {
      if (path[n * 2][n][i] == 1)
        printf("H");
      else
        printf("M");
    }
    printf("\n");
  }
  return 0;
}
