Consider the following algorithm:

Given one integer n. Please output the M after processing the algorithm.
The input includes multiple test cases. In each test case, the first line contains one integer n. Guarantee the algorithm won’t go into infinite steps when n is between 1 and 106.
1<= n <= 106
For Case1 and Case2, the value during operation will not exceed 10^7.
For Case3 and Case4, the value during operation will not exceed 10^11.
For Case1, the number of test case <= 5000
For Case2, the number of test case <= 50000
For Case3, the number of test case <= 500000
For Case4, the number of testcase <= 1600000
For each testcase, output one line contains one integer M.