#include <bits/stdc++.h>
using namespace std;
template <class T>
string toString(T n) {
  ostringstream oss;
  oss << n;
  oss.flush();
  return oss.str();
}
int toInt(string s) {
  int r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
template <class T>
void debug(T a) {
  cout << a << " ";
}
template <class T>
void debug(vector<T>& e) {
  int i;
  for (int i = 0; i < int(e.size()); ++i) cout << e[i] << " ";
  cout << endl;
}
template <class T>
void debug(vector<basic_string<T> >& e) {
  int i, j;
  for (int i = 0; i < SZ(e); ++i) {
    for (int j = 0; j < SZ(e[i]); ++j) cout << e[i][j];
    cout << endl;
  }
  cout << endl;
}
template <class T>
void debug(vector<vector<T> >& e, int row, int col) {
  int i, j;
  for (int i = 0; i < row; ++i) {
    for (int j = 0; j < col; ++j) cout << e[i][j] << "\t";
    cout << endl;
  }
  cout << endl;
}
char s[100], trace[100][100][100];
long long f[100][100][100];
long long mu10[20];
int N;
int main() {
  scanf("%d\n", &N);
  for (int i = 1; i <= N * 2; ++i) scanf("%c", &s[i]);
  for (int i = 0; i < N * 2 + 1; ++i)
    for (int j = 0; j < N + 1; ++j)
      for (int k = 0; k < N + 1; ++k) f[i][j][k] = -0x7f7f7f7f;
  f[N * 2][1][0] = s[N * 2] - '0';
  trace[N * 2][1][0] = 'H';
  f[N * 2][0][1] = s[N * 2] - '0';
  trace[N * 2][0][1] = 'M';
  mu10[0] = 1;
  for (int i = 1; i <= N; ++i) mu10[i] = mu10[i - 1] * 10;
  for (int i = N * 2 - 1; i >= 1; --i) {
    for (int j = 0; j <= N; ++j)
      for (int k = 0; k <= N; ++k) {
        if (j >= 1 && f[i + 1][j - 1][k] != -0x7f7f7f7f &&
            f[i][j][k] < f[i + 1][j - 1][k] + mu10[j - 1] * (s[i] - '0')) {
          f[i][j][k] = f[i + 1][j - 1][k] + mu10[j - 1] * (s[i] - '0');
          trace[i][j][k] = 'H';
        }
        if (k >= 1 && f[i + 1][j][k - 1] != -0x7f7f7f7f &&
            f[i][j][k] < f[i + 1][j][k - 1] + mu10[k - 1] * (s[i] - '0')) {
          f[i][j][k] = f[i + 1][j][k - 1] + mu10[k - 1] * (s[i] - '0');
          trace[i][j][k] = 'M';
        }
      }
  }
  int now1 = N, now2 = N;
  for (int i = 1; i <= N * 2; ++i) {
    printf("%c", trace[i][now1][now2]);
    if (trace[i][now1][now2] == 'H')
      --now1;
    else
      --now2;
  }
  return 0;
}
