#include <bits/stdc++.h>
using namespace std;
unsigned long long ans = 0;
int r = -1;
int n, g[40][21], p[40][21];
char ch;
void update(unsigned long long &a, int &b, int &c, unsigned long long d,
            int e) {
  if (b == 0 || a < d) {
    a = d;
    c = e;
    b = 1;
  }
}
unsigned long long f[40][21], bas[21], a[1010];
int main() {
  bas[1] = 1;
  for (int i = 2; i <= 19; i++) bas[i] = bas[i - 1] * 10LL;
  scanf("%d", &n);
  for (int i = 1; i <= n + n; i++) {
    scanf(" %c", &ch);
    a[i] = ch - '0';
  }
  g[0][0] = 1;
  f[0][0] = 0;
  for (int i = 1; i <= n + n; i++)
    for (int j = 0; j <= n; j++)
      if (g[i - 1][j]) {
        int d1 = j, d2 = i - 1 - j;
        d1 = n - d1, d2 = n - d2;
        if (d2 > 0)
          update(f[i][j], g[i][j], p[i][j], f[i - 1][j] + bas[d2] * a[i], j);
        if (j != n)
          update(f[i][j + 1], g[i][j + 1], p[i][j + 1],
                 f[i - 1][j] + bas[d1] * a[i], j);
      }
  int sx = n + n, sy = n;
  string a = "";
  while (sx != 0) {
    int ty = p[sx][sy];
    sx--;
    if (ty == sy)
      a += 'M';
    else
      a += 'H';
    sy = ty;
  }
  reverse(a.begin(), a.end());
  cout << a << endl;
}
