#include <iostream>
using namespace std;
int main()
{
int n, i;
cin >> n;
int a[n+2];
a[0]=-1; a[n+1]=-1;
for(i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++)
if(a[i]>a[i-1] && a[i]>a[i+1]) cout<<'E';
else cout<<'M';
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKQp7CiAgICBpbnQgbiwgaTsKICAgIGNpbiA+PiBuOwogICAgaW50IGFbbisyXTsKICAgIGFbMF09LTE7IGFbbisxXT0tMTsgCiAgICBmb3IoaT0xOyBpPD1uOyBpKyspIGNpbj4+YVtpXTsKICAgIGZvciAoaT0xOyBpPD1uOyBpKyspCiAgICAgICAgaWYoYVtpXT5hW2ktMV0gJiYgYVtpXT5hW2krMV0pIGNvdXQ8PCdFJzsKICAgICAgICBlbHNlIGNvdXQ8PCdNJzsKICAgIHJldHVybiAwOwp9Cg==