#include<stdio.h>
int main()
{
int n,a,b,c,t;
while(scanf("%d",&n)&&n)
{
a=b=c=0;
t=n;
while(t)
{
a+=t%10;
t/=10;
}
t=n;
while(t)
{
b+=t%16;
t/=16;
}
t=n;
while(t)
{
c+=t%12;
t/=12;
}
if(a==b&&a==c)
printf("%d is a Sky Number.\n",n);
else
printf("%d is not a Sky Number.\n",n);
}
return 0;
}
int main()
{
int n,a,b,c,t;
while(scanf("%d",&n)&&n)
{
a=b=c=0;
t=n;
while(t)
{
a+=t%10;
t/=10;
}
t=n;
while(t)
{
b+=t%16;
t/=16;
}
t=n;
while(t)
{
c+=t%12;
t/=12;
}
if(a==b&&a==c)
printf("%d is a Sky Number.\n",n);
else
printf("%d is not a Sky Number.\n",n);
}
return 0;
}