// editor5>
#include<stdio.h>
#include<math.h>
int main()
{
    int n,original,remainder,digit=0;
    scanf("%d",&n);
    if(n<0)
    {
        printf("invalid input");
        return 0;
    }
    orginal=n;
    int temp=n;
    if(temp==0)
    {
        digit=1;
    }
    else
    {
        while(temp!=0)
        {
            temp/=10;
            digit++;
        }
    }
    temp=n;
    int sum=0;
    while(temp!=0)
    {
        remainder=temp%10;
        sum+=pow(remainder,digit);
        temp/=10;
    }
    if(sum==orginal)
    {
        printf("armstrong");
    }
    else
    {
        printf("not armstrong");
    }
    return 0;
}
    
    
    
    
    
    
    
    
    
}