ZOJ Problem Set - 1633
We will construct an infinitely long string from two short strings: A = "^__^" (four characters), and B = "T.T" (three characters). Repeat the following steps:
The input contains multiple test cases, each contains only one integer N (1 <= N <= 2^63 - 1). Proceed to the end of file.
For each test case, print one character on each line, which is the N-th (index begins with 1) character of this infinite string.
1 2 4 8
T . ^ T
Author: CHENG, Long
Source: Zhejiang University Local Contest 2003