#include <bits/stdc++.h>
using namespace std;
string s;
long long ex[19], f[19][19];
int n;
int main() {
  cin >> n >> s;
  ex[1] = 1;
  for (int i = 2; i <= n; ++i) ex[i] = ex[i - 1] * 10;
  for (int i = 1; i <= n; i++) {
    int t = s[n * 2 - i] - 48;
    f[i][0] = f[i - 1][0] + t * ex[i];
  }
  for (int i = 1; i <= n; i++) {
    int t = s[n * 2 - i] - 48;
    f[0][i - 1] + t* ex[i];
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      int t = s[n * 2 - i - j] - 48;
      f[i][j] = f[i - 1][j] + t * ex[i];
      f[i][j] = max(f[i][j], f[i][j - 1] + t * ex[j]);
    }
  }
  int i = n;
  int j = n;
  while (i != 0 || j != 0) {
    int t = s[n * 2 - i - j] - 48;
    if (i != 0 && f[i - 1][j] + t * ex[i] == f[i][j]) {
      --i;
      cout << "H";
    } else {
      --j;
      cout << "M";
    }
  }
  return 0;
}
