逆向递推
#include <cstring>
#include <stdio.h>
#include <algorithm>
using namespace std;
#define LL long long
LL a[100];
int main()
{
char s[] = "T.T^__^";
a[0] = 4;
a[1] = 3;
LL n;
for( int i = 2; i<= 100 ; i++)
a[i] = a[i-1] + a[i -2];
while(scanf("%lld",&n) != EOF)
{
while( n > 7)
{
int pos = lower_bound(a , a + 100, n) - a;
if(n > a[pos - 1])
n -= a[pos - 1];
}
printf("%c\n",s[n-1]);
}
return 0;
}