#include <bits/stdc++.h>
const long long INF = 0x7FFFffffFFFFffffLL;
const int N = 52;
int n;
int str[N];
long long tens[N], dp[N][N];
bool dec[N][N];
long long solve(int x, int y) {
  if (dp[x][y] != -1) return dp[x][y];
  if (!x && !y) return 0;
  int cur = str[n * 2 - x - y + 1];
  long long r1 = x ? (cur * tens[x - 1] + solve(x - 1, y)) : -1,
            r2 = y ? (cur * tens[y - 1] + solve(x, y - 1)) : -1, res;
  if (r1 > r2)
    dec[x][y] = true, res = r1;
  else
    dec[x][y] = false, res = r2;
  return dp[x][y] = res;
}
void init() {
  memset(dp, -1, sizeof(dp));
  tens[0] = 1;
  for (int i = 1; i <= 18; i++) tens[i] = tens[i - 1] * 10;
}
int main() {
  init();
  scanf("%d%*c", &n);
  for (int i = 1; i <= n * 2; i++) str[i] = getchar() - '0';
  solve(n, n);
  int cx = n, cy = n;
  while (cx || cy) {
    putchar(dec[cx][cy] ? 'H' : 'M');
    if (dec[cx][cy])
      cx--;
    else
      cy--;
  }
  return 0;
}
