#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000;
int n, i, j;
char s[maxn];
long long F[maxn][maxn];
long long P[maxn];
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  P[1] = 1;
  for (i = 2; i <= 18; ++i) P[i] = 10LL * P[i - 1];
  memset(F, 0, sizeof F);
  for (i = 0; i <= n; ++i)
    for (j = 0; j <= n; ++j) {
      if (i)
        F[i][j] =
            max(F[i][j], F[i - 1][j] + P[i - 1] * (s[n + n - i - j] - '0'));
      if (j)
        F[i][j] =
            max(F[i][j], F[i][j - 1] + P[j - 1] * (s[n + n - i - j] - '0'));
    }
  i = n, j = n;
  while (i || j) {
    if (i && F[i][j] == (F[i - 1][j] + P[i - 1] * (s[n + n - i - j] - '0')))
      putchar('H'), --i;
    else
      putchar('M'), --j;
  }
  printf("\n");
  return 0;
}
