#include <bits/stdc++.h>
using namespace std;
template <class T>
void show(T a, int n) {
  for (int i = 0; i < n; ++i) cout << a[i] << ' ';
  cout << endl;
}
template <class T>
void show(T a, int r, int l) {
  for (int i = 0; i < r; ++i) show(a[i], l);
  cout << endl;
}
const int N = 20;
const int M = 5000;
const int oo = 10000 * 10000 * 10;
int n;
char s[N + N];
long long h[N];
long long dp[N][N];
char tag[N][N];
void print(int i, int j) {
  if (!i && !j) return;
  if (tag[i][j] == 'H')
    print(i - 1, j);
  else
    print(i, j - 1);
  putchar(tag[i][j]);
}
void solve() {
  int i, j, k;
  h[n] = 1;
  for (i = n - 1; i >= 1; --i) h[i] = h[i + 1] * 10;
  for (i = 1; i <= n; ++i) {
    int g = s[i] - '0';
    dp[i][0] = dp[i - 1][0] + g * h[i];
    tag[i][0] = 'H';
    dp[0][i] = dp[0][i - 1] + g * h[i];
    tag[0][i] = 'M';
  }
  for (i = 1; i <= n; ++i) {
    for (j = 1; j <= n; ++j) {
      int d = i + j;
      int g = s[d] - '0';
      dp[i][j] = (dp[i - 1][j] + g * h[i] > dp[i][j - 1] + g * h[j]
                      ? dp[i - 1][j] + g * h[i]
                      : dp[i][j - 1] + g * h[j]);
      if (dp[i - 1][j] + g * h[i] > dp[i][j - 1] + g * h[j])
        tag[i][j] = 'H';
      else
        tag[i][j] = 'M';
    }
  }
  print(n, n);
  putchar(10);
}
int main() {
  int i, j, cas = 0;
  scanf("%d", &n);
  while (getchar() != 10)
    ;
  scanf("%s", s + 1);
  solve();
  return 0;
}
