#include <iostream>
#include <string>
using namespace std;
int main(){
int round[61][61];
int n;
int temp[61];
string input;
while(cin>>input){
n=input.length();
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
round[i][j]=input[(j+i)%n]-'0';
}
}
bool allRound=true;
for(int f=1;f<=n && allRound;f++){
int addion=0;
//cout<<f<<"*";
for(int i=0;i<n;i++){
temp[i]=round[0][i];
//cout<<round[0][i];
}
//cout<<":";
int rem=0;
for(int i=n-1;i>=0;i--){
int all=temp[i]*f+rem;
temp[i]=all%10;
rem=all/10;
}
bool same=true;
bool hassame=false;
for(int i=0;i<n && !hassame;i++){
//temp to round[i].
same=true;
for(int j=0;j<n && same;j++){
if(temp[j]!=round[i][j])
{
same=false;
}
}
if(same)
hassame=true;
}
if(!hassame)
allRound=false;
}
for(int i=0;i<n;i++)
cout<<round[0][i];
if(allRound){
cout<<" is cyclic"<<endl;
}
else{
cout<<" is not cyclic"<<endl;
}
}
return 0;
}