#include using namespace std; string s; char x,y; int main() { while(1) { cin>>s>>x>>y; if(x=='0' && y=='0' && s=="0")return 0; else for(int i=0;i