#include <iostream> using namespace std; int main() { char M[12]={'1','0','X','9','8','7','6','5','4','3','2'}; char ID[19]; int w[19]={7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2}; int n,total,s=0; cin>>n; for(int i=0;i<n;i++) { cin>>ID; total=0; for(int i=0;i<17;i++) total+=w[i]*(ID[i]-48); total=total%11; if(M[total]!=ID[17]) { s=1; cout<<ID<<endl; } } if(s==0) cout<<"All passed"<<endl; return 0; }