Hash
题号:NC244823
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
Special Judge, 64bit IO Format: %lld

题目描述

Lucy is learning string hash algorithm .

For a given string S , she will execute the following code to get it's hash code .

//Language C++14
long long mod=5999993;
long long gethas(string s)
{
    long long ret=0;
    for (char c:s)
    ret=(ret*29+(c-'a'+1))%mod;
    return ret;
}

Ruby thinks the value of mod is not big enough , so he decides to generate a string T meets the following conditions .

1. T only contains lowercase English letters .

2. S is a prefix of T .

3. Hash code of S and T are the same .

4. . means the length of string S .

输入描述:

The first line contains an integer  .

Then T lines follow , each line contains a string S . ( , S only contains lowercase English letters) .

To avoid unknown errors , please do not read data in the way of character by character .

输出描述:

For each case , print the answer T in one line .

If there are multiple answers , print any one .
示例1

输入

复制
2
c
n

输出

复制
caiztjx
naeqazn

说明

hash(c)=hash(caiztjx)=3, cficzo is also ok .

hash(n)=hash(naeqazn)=14, nisqlt is also ok .