#include <bits/stdc++.h>
int main(int argc, char *argv[]) {
  char d[101];
  int64_t n;
  if (fscanf(stdin, "%" SCNd64 " %100s", &n, d) != 2 || n < 1 || 18 < n ||
      strlen(d) != 2 * n) {
    fprintf(stderr, "fscanf: Header IO error.\n");
    exit(EXIT_FAILURE);
  }
  struct {
    int64_t sr, sc, d;
  } m[n + 1][n + 1];
  memset(m, 0, sizeof(m));
  for (int64_t i = 1, s = 0; i <= n; i++) {
    m[i][0].sr = m[0][i].sc = s += (d[2 * n - i] - '0') * powl(10, i - 1);
    m[i][0].d = true;
  }
  for (int64_t r = 1; r <= n; r++)
    for (int64_t c = 1; c <= n; c++) {
      const int64_t srr =
          m[r - 1][c].sr + (d[2 * n - r - c] - '0') * powl(10, r - 1);
      const int64_t src = m[r - 1][c].sc;
      const int64_t scr = m[r][c - 1].sr;
      const int64_t scc =
          m[r][c - 1].sc + (d[2 * n - r - c] - '0') * powl(10, c - 1);
      m[r][c].d = (scr + scc <= srr + src);
      if (m[r][c].d) {
        m[r][c].sr = srr;
        m[r][c].sc = src;
      } else {
        m[r][c].sr = scr;
        m[r][c].sc = scc;
      }
    }
  for (int64_t r = n, c = n, d; r > 0 || c > 0; d = m[r][c].d, r -= d, c -= !d)
    printf("%c", m[r][c].d ? 'H' : 'M');
  printf("\n");
  return EXIT_SUCCESS;
}
