#include <bits/stdc++.h>
using namespace std;
unsigned long long poww(unsigned long long a, unsigned long long b,
                        unsigned long long md) {
  return (!b ? 1
             : (b & 1 ? a * poww(a * a % md, b / 2, md) % md
                      : poww(a * a % md, b / 2, md) % md));
}
const unsigned long long MAXN = 18 + 10;
const unsigned long long INF = 8e18;
const unsigned long long MOD = 1e9 + 7;
pair<unsigned long long, unsigned long long> dp[MAXN][MAXN];
unsigned long long n, tpow[MAXN];
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> s;
  reverse((s).begin(), (s).end());
  dp[0][0] = {0, 4};
  tpow[0] = 1;
  for (int i = 1; i <= 18; i++) tpow[i] = tpow[i - 1] * 10ll;
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= n; j++) {
      if (i + j == 0) continue;
      dp[i][j] = {0, 1};
      if (i > 0)
        dp[i][j] = max(
            dp[i][j],
            {dp[i - 1][j].first + int(s[i + j - 1] - '0') * tpow[i - 1], 1});
      if (j > 0)
        dp[i][j] = max(
            dp[i][j],
            {dp[i][j - 1].first + int(s[j + i - 1] - '0') * tpow[j - 1], 2});
    }
  }
  string ans;
  unsigned long long i = n, j = n;
  while (i + j) {
    if (dp[i][j].second == 1)
      i--, ans.push_back('H');
    else
      j--, ans.push_back('M');
  }
  cout << ans << '\n';
  return 0;
}
