#include <bits/stdc++.h>
using namespace std;
pair<long double, long double> p[50][50];
long double dp[50][50];
int n;
long double t[20];
string s;
int main() {
  ios_base::sync_with_stdio(false);
  long double T = 1;
  for (int i = 0; i < 20; i++) {
    t[i] = T;
    T *= 10;
  }
  cin >> n >> s;
  for (int i = 0; i < 40; i++)
    for (int j = 0; j < 40; j++) dp[i][j] = 0, p[i][j] = make_pair(0, 0);
  reverse(s.begin(), s.end());
  for (int i = 1; i <= 2 * n; i++)
    for (int j = 0; j <= i; j++) {
      int x = i - j;
      long double d = s[i - 1] - '0';
      if (x > n || j > n || x + j == 0) continue;
      if (x != 0)
        p[x][j] = make_pair(-1, 0), dp[x][j] = dp[x - 1][j] + d * t[x];
      if (j != 0)
        if (x == 0 || dp[x][j] < dp[x][j - 1] + d * t[j])
          p[x][j] = make_pair(0, -1), dp[x][j] = dp[x][j - 1] + d * t[j];
    }
  int a = n, b = n;
  vector<string> v;
  while ((a + b) != 0) {
    int aa = a + p[a][b].first, bb = b + p[a][b].second;
    if (p[a][b].first)
      v.push_back("H");
    else
      v.push_back("M");
    a = aa, b = bb;
  }
  for (int i = 0; i < v.size(); i++) cout << v[i];
  return -0;
}
