#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
const int N = 1e6+10;
int t,n,m,k,l,r,op,x,y;
string str;
int g[18] = {-1,7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};
void solve(){
while(cin>>str){
if(str.size()!=18){
cout<<"ID Wrong"<<"\n";
continue;
}
str="~"+str;
x = str.back();
y = 0;
if(x=='X')x=10;
else x=x-'0';
for(int i = 1;i<=17;i++){
y += g[i] * (str[i]-'0');
}
y%=11;
if((x+y)%11==1){
cout<<"ID Correct";
}else{
cout<<"ID Wrong";
}
cout<<"\n";
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
solve();
return 0;
}