#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> dp[20][20];
pair<int, int> pre[20][20];
long long base[20];
void init() {
  for (int i = 0; i < 20; i++)
    for (int j = 0; j < 20; j++) dp[i][j] = make_pair(0, 0);
  base[1] = 1;
  for (int i = 2; i < 20; i++) base[i] = base[i - 1] * 10;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  init();
  for (int i = 1; i <= n; i++) {
    dp[0][i] =
        make_pair(0, dp[0][i - 1].second + (s[2 * n - i] - '0') * base[i]);
    pre[0][i] = make_pair(0, i - 1);
  }
  for (int i = 1; i <= n; i++) {
    dp[i][0] =
        make_pair(dp[i - 1][0].first + (s[2 * n - i] - '0') * base[i], 0);
    pre[i][0] = make_pair(i - 1, 0);
    for (int j = 1; j <= n; j++) {
      if (dp[i][j - 1].first + dp[i][j - 1].second +
              (s[2 * n - i - j] - '0') * base[j] >=
          dp[i][j].first + dp[i][j].second) {
        dp[i][j] =
            make_pair(dp[i][j - 1].first,
                      dp[i][j - 1].second + (s[2 * n - i - j] - '0') * base[j]);
        pre[i][j] = make_pair(i, j - 1);
      }
      if (dp[i - 1][j].first + (s[2 * n - i - j] - '0') * base[i] +
              dp[i - 1][j].second >=
          dp[i][j].first + dp[i][j].second) {
        dp[i][j] =
            make_pair(dp[i - 1][j].first + (s[2 * n - i - j] - '0') * base[i],
                      dp[i - 1][j].second);
        pre[i][j] = make_pair(i - 1, j);
      }
    }
  }
  int i, j;
  i = j = n;
  while (i > 0 || j > 0) {
    int ii = pre[i][j].first;
    int jj = pre[i][j].second;
    if (i == ii)
      cout << "H";
    else
      cout << "M";
    i = ii;
    j = jj;
  }
  return 0;
}
