The Move-to-Front (MTF) transform is an encoding scheme that maps input data to a sequence of numbers. Entropy encoders often reach a better compression ratio on data that has passed through the MTF transform. The transform itself is simple. The scheme below is the MTF transform on a string made of lowercase letters only.
Applying the transform to the string hakka goes like this.
So the MTF transform maps hakka to the sequence (7,1,10,0,1).
Write a program that inverts the MTF transform. Given a sequence (a1,…,an), compute the string s that the MTF transform maps to (a1,…,an).
The first line contains an integer T, the number of test cases, with T≤50.
Each test case consists of two lines. The first line contains a positive integer n, the length of the sequence, with 1≤n≤100. The second line contains the integers a1,…,an separated by blanks, with ai∈{0,1,…,25} for every i.
For each test case, print on its own line the string s that the MTF transform maps to (a1,…,an).