#include <bits/stdc++.h>
using namespace std;
string s, ss;
int cnt[1 << 18];
unsigned long long f[2][22];
int g[2][22];
int n;
unsigned long long mx;
long long bmask;
int main() {
  cin >> n;
  for (int(i) = 0; (i) < (1 << n); ++(i))
    for (int(j) = 0; (j) < (n); ++(j))
      if (i & (1 << j)) ++cnt[i];
  for (int(step) = 0; (step) < (2); ++(step)) {
    s = "";
    for (int(i) = 0; (i) < (n); ++(i)) {
      char ch;
      cin >> ch;
      s += ch;
    }
    for (int(i) = 0; (i) < (1 << n); ++(i)) {
      unsigned long long v1 = 0, v2 = 0;
      for (int(j) = 0; (j) < (n); ++(j))
        if (i & (1 << j))
          v1 = v1 * 10 + s[j] - '0';
        else
          v2 = v2 * 10 + s[j] - '0';
      if (!step) {
        ss = s;
        for (int(j) = 0; (j) < (n - cnt[i]); ++(j)) v1 *= 10;
        for (int(j) = 0; (j) < (cnt[i]); ++(j)) v2 *= 10;
      }
      if (v1 + v2 > f[step][cnt[i]]) {
        f[step][cnt[i]] = v1 + v2;
        g[step][cnt[i]] = i;
      }
    }
  }
  bmask = (1 << n) - 1;
  for (int(i) = 0; (i) < (n + 1); ++(i))
    if (f[0][i] + f[1][n - i] > mx) {
      mx = f[0][i] + f[1][n - i];
      bmask = ((long long)(g[1][n - i]) << n) + g[0][i];
    }
  for (int(i) = 0; (i) < (n * 2); ++(i))
    if (bmask & (1LL << i))
      cout << "H";
    else
      cout << "M";
  cout << endl;
  return 0;
}
