#include<stdio.h>
#include<math.h>
int main()
{
    int n;
    scanfg(" %d",&v);
    if(v <0)
    {
        printf("Invalid Input/n");
    }
    else
    {
        int originalnum-v;
        int numdigits =0;
        int temp = v;
        if(temp-0)
        {
            numdigits = 1;
        }
        else
        {
            while(temp >0)
            {
                temp /=10;
                numdigits++;
            }
        }
        int sumofnpowers = 0;
        temp =n;
        while (temp > 0)
        {
            sumofpowers+=pow(digit,numdigits);
            temp /=10;
        }
        if(sumofpowers == originalnum)
        {
            printf("armstrong\n");
        }
        else
        {
            printf("not armstrong\n");
        }
    }
    return 0;
}