﻿ Fuzhou University OnlineJudge ﻿
Problem 1861 Funny Hash game II

## Problem Description

A classic string hashing algorithm can be simply described by the following code:

unsigned long long hash(string str) { unsigned long long ret= 5381; int i; for (i = 0;i < str.size(); i++) ret=(ret* 33)^str[i]; //xor operation return ret; }

You will be given a hash value of some random string,and you are required to invert this algorithm and try to find a satisfied string.
Note that both the random string we choose and the answer you submit must satisfy the following two conditions:
1.The length of the string is not large than 8.
2.The string is composed of only letters (‘A’ to ‘Z’,’a’ to ‘z’).
If there are more than one solution,the one with less length is prefered,if there is still a tie,you shall choose the the lexicographically smallest one.

## Input

Input contains multiple cases.Test cases are separated by several blank lines.
Each test case starts with a integer N(0 <= N < 2^64),which reperesents the hash value of some chosen string.
There are no more than 500 test cases.

## Output

For each case,output the satisfied string as described above.

## Sample Input

193411340 210623374112 193415041 193434013 193422026 193421459

## Sample Output

fzu acorz bnh xzz ths tzx

## Source

FOJ月奖月赛-2009年11月

Submit  Back  Status  Discuss
﻿