#include char s[20][100001]; int main(int argc, char const *argv[]){ int t,f; long len[20],i,c[20],j; scanf("%d",&t); getchar(); for(i=0;i=0;j--){ if(f==0 && '0'<=s[i][j] && s[i][j]<='9'){ if(s[i][j]=='9'){ f=1; s[i][j]='0'; continue; }else{ s[i][j]++; break; } } if(f==1){ if('0'<=s[i][j] && s[i][j]<'9'){ s[i][j]++; break; } if(s[i][j]=='9') s[i][j]='0'; else{ c[i]=j+1; break; } } } if(f==1) c[i]=0; } for(i=0;i