#include <iostream>
using namespace std;
int main()
{
int x = 27;
for(unsigned int i=0; i < 10; ++i)
{
std::cout << i << " : " << i*1000000000 << " : " << x << std::endl;
if(x==1) break;
x = x%2 ? x*3+1 : x/2;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKCmludCBtYWluKCkKewogICAgaW50IHggPSAyNzsKICAgIGZvcih1bnNpZ25lZCBpbnQgaT0wOyBpIDwgMTA7ICsraSkKICAgIHsKICAgICAgICBzdGQ6OmNvdXQgPDwgaSA8PCAiIDogIiA8PCBpKjEwMDAwMDAwMDAgPDwgIiA6ICIgPDwgeCA8PCBzdGQ6OmVuZGw7CiAgICAgICAgaWYoeD09MSkgYnJlYWs7CiAgICAgICAgeCA9IHglMiA/IHgqMysxIDogeC8yOwogICAgfQp9