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