#include <bits/stdc++.h>
using namespace std;
const int maxn = 20;
long long dp[maxn][maxn];
long long pw[maxn];
char dad[maxn][maxn];
int main() {
  long long q = 1;
  for (int i = 0; i < maxn; ++i) {
    pw[i] = q;
    q *= 10;
  }
  int n;
  cin >> n;
  string s;
  cin >> s;
  reverse(s.begin(), s.end());
  string ans;
  for (int i = 0; i < n + 1; ++i) {
    for (int j = 0; j < n + 1; ++j) {
      if (i != 0 && ((s[i + j - 1] - '0') * pw[i - 1] + dp[i - 1][j]) >=
                        ((s[i + j - 1] - '0') * pw[j - 1] + dp[i][j - 1])) {
        dad[i][j] = 'M';
        dp[i][j] = ((s[i + j - 1] - '0') * pw[i - 1] + dp[i - 1][j]);
      }
      if (j != 0 && ((s[i + j - 1] - '0') * pw[i - 1] + dp[i - 1][j]) <=
                        ((s[i + j - 1] - '0') * pw[j - 1] + dp[i][j - 1])) {
        dad[i][j] = 'H';
        dp[i][j] = ((s[i + j - 1] - '0') * pw[j - 1] + dp[i][j - 1]);
      }
    }
  }
  for (int i = n, j = n; i + j > 0;) {
    cout << dad[i][j];
    if (dad[i][j] == 'M')
      --i;
    else
      --j;
  }
  cout << endl;
}
