#include using namespace std; char str[15]; int main() { int T,n;scanf("%d",&T); while(T--) { scanf("%s",str);int l=strlen(str); bool f=true; if(str[0]!='1')f=false; for(int i=2;i