For two strings AA and BB, let A+BA+B denote the concatenation of AA and BB in this order. You are given NN strings S_1,\ldots,S_NS1,…,SN. Modify and print them as follows, in the order i=1, \ldots, Ni=1,…,N:
if none of S_1,\ldots,S_{i-1}S1,…,Si−1 is equal to S_iSi, print S_iSi;
if XX(X>0)(X>0) of S_1,\ldots,S_{i-1}S1,…,Si−1 are equal to S_iSi, print S_i+Si+ ( +X++X+ ), treating XX as a string.
Constraints
1 \leq N \leq 2\times 10^51≤N≤2×105
S_iSi is a string of length between 11 and 1010 (inclusive) consisting of lowercase English letters.
Input
Input is given from Standard Input in the following format:
NNS_1S1S_2S2\vdots⋮S_NSN
Output
Print NN lines as specified in the Problem Statement.