#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
template <typename T>
int size(T& a) {
  return (int)a.size();
}
template <typename T>
T sqr(T a) {
  return a * a;
}
long long dm[40][40][40];
int pr[40][40][40][2];
long long bp(long long a, long long n) {
  long long r = 1;
  while (n) {
    if (n % 2 == 1) r *= a;
    if (n /= 2) a *= a;
  }
  return r;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  memset((dm), (255), sizeof(dm));
  dm[0][0][0] = 0;
  for (int i = size(s) - 1, p = 0; i >= 0; --i, ++p) {
    for (int c0 = 0; c0 < 20; ++c0)
      for (int c1 = 0; c1 < 20; ++c1) {
        if (dm[p][c0][c1] == -1) continue;
        if (dm[p + 1][c0 + 1][c1] == -1 ||
            dm[p + 1][c0 + 1][c1] < dm[p][c0][c1] + (s[i] - '0') * bp(10, c0)) {
          dm[p + 1][c0 + 1][c1] = dm[p][c0][c1] + (s[i] - '0') * bp(10, c0);
          pr[p + 1][c0 + 1][c1][0] = c0;
          pr[p + 1][c0 + 1][c1][1] = c1;
        }
        if (dm[p + 1][c0][c1 + 1] == -1 ||
            dm[p + 1][c0][c1 + 1] < dm[p][c0][c1] + (s[i] - '0') * bp(10, c1)) {
          dm[p + 1][c0][c1 + 1] = dm[p][c0][c1] + (s[i] - '0') * bp(10, c1);
          pr[p + 1][c0][c1 + 1][0] = c0;
          pr[p + 1][c0][c1 + 1][1] = c1;
        }
      }
  }
  int res = -1;
  int vi = n, vj = n;
  n *= 2;
  string path = "";
  while (vi || vj) {
    int pp0 = pr[n][vi][vj][0];
    int pp1 = pr[n][vi][vj][1];
    if (pp0 != vi)
      path.push_back('H');
    else
      path.push_back('M');
    --n;
    vi = pp0;
    vj = pp1;
  }
  cout << path;
  return 0;
}
