#include <bits/stdc++.h>
using namespace std;
const int MAXN = 25;
char num[MAXN * 2];
int numint[MAXN * 2];
long long dp[MAXN * 2][MAXN];
long long ten[MAXN];
int pre[MAXN * 2][MAXN];
int n;
char path[MAXN * 2];
int main() {
  scanf("%d", &n);
  scanf("%s", num);
  for (int i = 0; i < 2 * n; i++) numint[i] = num[i] - '0';
  ten[0] = 1;
  for (int i = 1; i < n; i++) ten[i] = ten[i - 1] * 10;
  for (int i = 0; i <= n * 2; i++)
    for (int j = 0; j <= n; j++) dp[i][j] = LONG_LONG_MIN;
  dp[0][0] = 0;
  for (int i = 1; i <= n * 2; i++)
    for (int j = 0; j <= min(i, n); j++) {
      if (j > 0 && dp[i - 1][j - 1] + numint[i - 1] * ten[n - j] > dp[i][j])
        dp[i][j] = dp[i - 1][j - 1] + numint[i - 1] * ten[n - j], pre[i][j] = 0;
      if (i > j && dp[i - 1][j] + numint[i - 1] * ten[n - i + j] > dp[i][j])
        dp[i][j] = dp[i - 1][j] + numint[i - 1] * ten[n - i + j], pre[i][j] = 1;
    }
  for (int i = n * 2 - 1, x = n * 2, y = n; i >= 0; i--) {
    if (pre[x][y] == 0)
      path[i] = 'H', x--, y--;
    else
      path[i] = 'M', x--;
  }
  path[n * 2] = '\0';
  printf("%s\n", path);
  return 0;
}
