#include <stdio.h>
int sum_number(int i){
int my_sum=0;
int num=i;
while (num>9){
//printf("sum_number:%d\n",num);
my_sum +=num%10;
num = num/10;
}
my_sum +=num;
return my_sum;
}
int main(){
int num;
int pre_num=-1;
int count=0;
if (scanf("%d",&num)!=0){
while (num!=pre_num && count<10){
count++;
pre_num = num;
num = sum_number(num)*3+1;
printf("%d:%d\n",count,num);
//printf("%d:%d\n",pre_num,num);
}
}else{
printf("输入信息存在错误");
}
return 0;
}