There is a new TV game on BerTV. In this game two players get a number A consisting of 2n digits. Before each turn players determine who will make the next move. Each player should make exactly n moves. On it's turn i-th player takes the leftmost digit of A and appends it to his or her number Si. After that this leftmost digit is erased from A. Initially the numbers of both players (S1 and S2) are «empty». Leading zeroes in numbers A, S1, S2 are allowed. In the end of the game the first player gets S1 dollars, and the second gets S2 dollars.

One day Homer and Marge came to play the game. They managed to know the number A beforehand. They want to find such sequence of their moves that both of them makes exactly n moves and which maximizes their total prize. Help them.

Input

The first line contains integer n (1 ≤ n ≤ 18). The second line contains integer A consisting of exactly 2n digits. This number can have leading zeroes.

Output

Output the line of 2n characters «H» and «M» — the sequence of moves of Homer and Marge, which gives them maximum possible total prize. Each player must make exactly n moves. If there are several solutions, output any of them.

Examples

Input

2
1234


Output

HHMM

Input

2
9911


Output

HMHM

import java.awt.geom.*;
import java.util.*;
import java.io.*;
import java.math.*;
import java.util.regex.*;

public class Main {
       
    static InputReader in;
        
    public static void main(String[] args) throws IOException{        
        
        File file = new File("input.txt");
        if( file.exists() )in = new InputReader( new FileInputStream( file ) );
        else in = new InputReader( System.in );
        
        final long oo=Long.MAX_VALUE/2;
        int n=in.nextInt();
        char num[]=in.next().toCharArray();
        long dp[][][]=new long[2*n+1][n+1][n+1];
        boolean ans[][][]=new boolean[2*n+1][n+1][n+1];
        
        long ten[]=new long[n+1];
        ten[0]=1;
        for( int i=1; i<=n; i++ ) ten[i]=10L*ten[i-1];
        
        for( int i=0; i<dp.length; i++ )
        for( int j=0; j<dp[i].length; j++ )    
            Arrays.fill( dp[i][j], -oo );
        
        dp[2*n][0][0]=0;
        
        for( int i=2*n-1; i>=0; i-- )
        for( int j=0; j<=n; j++ )
        for( int k=0; k<=n; k++ ) {
            if( j>0 && ten[j-1]*(num[i]-'0')+dp[i+1][j-1][k]>dp[i][j][k] ) {
                dp[i][j][k]=ten[j-1]*(num[i]-'0')+dp[i+1][j-1][k];
                ans[i][j][k]=true;
            }
            if( k>0 && ten[k-1]*(num[i]-'0')+dp[i+1][j][k-1]>dp[i][j][k] ) {
                dp[i][j][k]=ten[k-1]*(num[i]-'0')+dp[i+1][j][k-1];
                ans[i][j][k]=false;
            }
        }
        
        //out( dp[0][n][n] );
        for(int i=0, j=n, k=n; i<2*n; i++ ) {
            if( ans[i][j][k] ) {
                System.out.print("H");
                j--;
            } else {
                System.out.print("M");
                k--;
            }
        }
        System.out.println("");
    } 
      
     // IO utilities:
    
    static void out( Object ...o ){ 
        System.out.println( Arrays.deepToString( o ) ); 
    } 
    
    static class InputReader {
        
        private BufferedInputStream inp;
	private int offset;
	private final int size=5120000;
        private byte buff[];
 
        InputReader( InputStream in ) throws IOException {
		inp = new BufferedInputStream( in );
                buff=new byte[size];
                offset=0;
		inp.read( buff, 0, size );
	}
        
        private void copyLeftovers() throws IOException {
            
            int j = 0;
            for ( ; offset<size; j++, offset++ ) 
                buff[j] = buff[offset];
            // and now fill the buffer
            inp.read( buff, j, size - j );
        }
 
	int nextInt() throws IOException {
            
            int parsedInt=0, by=1;
            int i=offset;
            if( buff[i]==0 ) throw new IOException(); //EOF
            // skip any non digits
            while ( i<size && ( (buff[i]<'0' || buff[i]>'9') && buff[i]!='-' ) ) i++;
            // read digits and parse number
            if( i<size && buff[i]=='-' ) {
                by=-1;
                i++;
            }
            while( i<size && buff[i]>='0' && buff[i]<='9') {
                parsedInt*=10;
                parsedInt+=buff[i]-'0';
                i++;
            }
            // check if we reached end of buffer
            if ( i==size ) {
                // copy leftovers to buffer start
		copyLeftovers();
		// and attempt to parse int again
		offset = 0;
		parsedInt = nextInt();
            } else offset=i;
            return parsedInt*by;
	}
        
        long nextLong() throws IOException{
            
            long parsedLong=0, by=1;
            int i=offset;
            if( buff[i]==0 ) throw new IOException(); //EOF
            // skip any non digits
            while ( i<size && ( (buff[i]<'0' || buff[i]>'9') && buff[i]!='-' ) ) i++;
            // read digits and parse number
            if( i<size && buff[i]=='-' ) {
                by=-1;
                i++;
            }
            while( i<size && buff[i]>='0' && buff[i]<='9') {
                parsedLong*=10L;
                parsedLong+=buff[i]-'0';
                i++;
            }
            // check if we reached end of buffer
            if ( i==size ) {
                // copy leftovers to buffer start
		copyLeftovers();
		// and attempt to parse long again
		offset = 0;
		parsedLong = nextLong();
            } else offset=i;
            return parsedLong*by;
        }
        
        double nextDouble() throws IOException{
            
            double parsedDouble=0, by=1;
            int i=offset;
            if( buff[i]==0 ) throw new IOException(); //EOF
            // skip any non digits
            while ( i<size && ( (buff[i]<'0' || buff[i]>'9') && buff[i]!='-' 
                    && buff[i]!='.' ) ) i++;
            // read digits and parse number
            if( i<size && buff[i]=='-' ) {
                by=-1;
                i++;
            }
            while( i<size && buff[i]>='0' && buff[i]<='9') {
                parsedDouble*=10;
                parsedDouble+=buff[i]-'0';
                i++;
            }
            if( i<size && buff[i]=='.' ) {
                double div=10;
                i++;
                while( i<size && buff[i]>='0' && buff[i]<='9') {
                    parsedDouble+=(buff[i]-'0')/div;
                    div*=10;
                    i++;
                }
            }
            // check if we reached end of buffer
            if ( i==size ) {
                // copy leftovers to buffer start
		copyLeftovers();
		// and attempt to parse double again
		offset = 0;
		parsedDouble=nextDouble();
            } else offset=i;
            return parsedDouble*by;
        }
        
        String next() throws IOException {
            
            StringBuilder token=new StringBuilder();
            int i=offset;
            if( buff[i]==0 ) throw new IOException(); //EOF
            // skip any non chars
            while( i<size && ( buff[i]=='\n' || buff[i]==' ' || buff[i]=='\r' ||
                    buff[i]=='\t' ) ) i++;
            // read chars
            while( i<size && buff[i]!='\n' && buff[i]!=' ' && buff[i]!='\r' &&
                    buff[i]!='\t' && buff[i]!=0 ) {
                token.append( (char)buff[i] );
                i++;
            }
            // check if we reached end of buffer
            if ( i==size ) {
                // copy leftovers to buffer start
		copyLeftovers();
		// and attempt to parse again
		offset = 0;
		return next();
            } else offset=i;
            return token.toString();
        }
        
        int[] nextInts( int n ) throws IOException {
            int arr[]=new int[n];
            for( int i=0; i<n; i++ ) arr[i]=in.nextInt();
            return arr;
        }
        
        long[] nextLongs( int n ) throws IOException {
            long arr[]=new long[n];
            for( int i=0; i<n; i++ ) arr[i]=in.nextLong();
            return arr;
        }
        
        double[] nextDoubles( int n ) throws IOException {
            double arr[]=new double[n];
            for( int i=0; i<n; i++ ) arr[i]=in.nextDouble();
            return arr;
        }
        
    }
}