#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long dp[20][20];
long long tp[20];
int cur[20][20];
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  int n;
  cin >> n;
  string s;
  cin >> s;
  tp[0] = 1;
  for (int i = 1; i < (n + 1); ++i) tp[i] = tp[i - 1] * 10LL;
  for (int i = 0; i < (n + 1); ++i)
    for (int j = 0; j < (n + 1); ++j) dp[i][j] = -5e18;
  dp[0][0] = 0;
  for (int i = 0; i < (n + 1); ++i) {
    for (int j = 0; j < (n + 1); ++j) {
      if (i + j == 0) continue;
      if (i) {
        long long tmp =
            dp[i - 1][j] + tp[n - i] * (long long)(s[i + j - 1] - '0');
        if (tmp > dp[i][j]) {
          dp[i][j] = tmp;
          cur[i][j] = 0;
        }
      }
      if (j) {
        long long tmp =
            dp[i][j - 1] + tp[n - j] * (long long)(s[i + j - 1] - '0');
        if (tmp > dp[i][j]) {
          dp[i][j] = tmp;
          cur[i][j] = 1;
        }
      }
    }
  }
  string t = "";
  int a = n, b = n;
  while (a + b) {
    if (cur[a][b])
      t += "H", b--;
    else
      t += "M", a--;
  }
  reverse(t.begin(), t.end());
  cout << t << endl;
  return 0;
}
