#include using namespace std; int main() { string x; char a,b; while(cin>>x>>a>>b) { if(a=='0' && b=='0' &&x=="0") break; for(int i=0;i