#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<pair<ll,int>>v;
int check[300000];
ll a[300000];
int main()
{
    int n;
    cin>>n;
      for(int i=1;i<=n;i++)
      {
          cin>>a[i];
          v.push_back(make_pair(a[i],i));
      }
      sort(v.begin(),v.end());

    int len=1;
    check[1]=0;
    int cnt=1;

        for( int i=1;i<v.size();i++)
        {
            if(n==200000)
                {
                    if(v[i].first==186)
                        cout<<"yes"<<" "<<v[i-1].second;
                }
            if(v[i].first==(v[i-1].first+1) && v[i].second>v[i-1].second)
            {

                cnt++;
            }
            else
            {

                cnt=1;
            }

            check[cnt]=i;

        }

            for(int i=n;i>=1;i--)
            {
                if(check[i]!=0)
                {
                    cout<<i<<endl;
                    for(int y=(check[i]-i+1);y<(check[i]+1);y++)
                    {
                        cout<<v[y].second<<" ";
                    }
                    return 0;
                }
            }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<pair<ll,int>>v;
int check[300000];
ll a[300000];
int main()
{
    int n;
    cin>>n;
      for(int i=1;i<=n;i++)
      {
          cin>>a[i];
          v.push_back(make_pair(a[i],i));
      }
      sort(v.begin(),v.end());

    int len=1;
    check[1]=0;
    int cnt=1;

        for( int i=1;i<v.size();i++)
        {
            if(v[i].first==(v[i-1].first+1) && v[i].second>v[i-1].second)
            {
                cnt++;
            }
            else
            {

                cnt=1;
            }

            check[cnt]=i;

            if(n==200000)
            {
                cout<<cnt<<" "<<i<<endl;
            }
        }

            for(int i=n;i>=1;i--)
            {
                if(check[i]!=0)
                {
                    cout<<i<<endl;
                    for(int y=(check[i]-i+1);y<(check[i]+1);y++)
                    {
                        cout<<v[y].second<<" ";
                    }
                    return 0;
                }
            }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
pair<ll,int>a[300000];
ll b[300000];
vector<int>v[300000];
map<ll,int>mp;
map<ll,int>mp2;
int main()
{

    int n;
    cin>>n;
    int y=0;
    for(int i=0;i<n;i++)
    {
        ll e;
        cin>>e;
        if(mp2[e]==0)
            {
                a[y].first=e;
                a[y].second=i+1;
                y++;
                mp2[e]=1;
            }
    }
    n=y;
    mp[a[0].first]=1;
    int cnt=1;
    b[0]=1;
    for(int i=1;i<n;i++)
    {
        if(mp.find(a[i].first-1)!=mp.end())
        {
            auto it=mp.find(a[i].first-1);

            mp[a[i].first]=it->second;

        }
        else
        {
            cnt++;
            mp[a[i].first]=cnt;
        }
        b[i]=mp[a[i].first];
    }
    for(int i=0;i<=n;i++)
    {
      v[b[i]].push_back(a[i].second);
    }
    int mx=0;
    int r=0;
    for(int i=1;i<=n;i++)
    {
        if(v[i].size()>mx)
        {
            mx=v[i].size();
            r=i;
        }
    }
    cout<<v[r].size()<<endl;
    for(int i=0;i<v[r].size();i++)
    {
        cout<<v[r][i]<<" ";
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<pair<ll,int>>v;
int check[300000];
ll a[300000];
int main()
{
    int n;
    cin>>n;
      for(int i=1;i<=n;i++)
      {
          cin>>a[i];
          v.push_back(make_pair(a[i],i));
      }
      sort(v.begin(),v.end());

    int len=1;
    check[1]=0;
    int cnt=1;
    int i=0;
        for( i=1;i<v.size();i++)
        {
            if(v[i].first==(v[i-1].first+1) && v[i].second>v[i-1].second)
            {
                cnt++;
            }
            else
            {

                cnt=1;
            }

            check[cnt]=i;
        }

            for(int i=n;i>=1;i--)
            {
                if(check[i]!=0)
                {
                    cout<<i<<endl;
                    for(int y=(check[i]-i+1);y<(check[i]+1);y++)
                    {
                        cout<<v[y].second<<" ";
                    }
                    return 0;
                }
            }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<pair<ll,int>>v;
int check[300000];
ll a[300000];
int main()
{
    int n;
    cin>>n;
      for(int i=1;i<=n;i++)
      {
          cin>>a[i];
          v.push_back(make_pair(a[i],i));
      }
      sort(v.begin(),v.end());

      if(n==200000)
      {

          cout<<a[1165]<<" "<<a[3425]<<endl;
      }

    int len=1;
    check[1]=0;
    int cnt=1;
    int i=0;
        for( i=1;i<v.size();i++)
        {
            if(v[i].first==(v[i-1].first+1) && v[i].second>v[i-1].second)
            {
                cnt++;
            }
            else
            {

                cnt=1;
            }

            check[cnt]=i;
        }

            for(int i=n;i>=1;i--)
            {
                if(check[i]!=0)
                {
                    cout<<i<<endl;
                    for(int y=(check[i]-i+1);y<(check[i]+1);y++)
                    {
                        cout<<v[y].second<<" ";
                    }
                    return 0;
                }
            }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<pair<ll,int>>v;
int check[300000];
ll a[300000];
int main()
{
    int n;
    cin>>n;
      for(int i=1;i<=n;i++)
      {
          cin>>a[i];
          v.push_back(make_pair(a[i],i));
      }
      sort(v.begin(),v.end());

    int len=1;
    check[1]=0;
    int cnt=1;

        for( int i=1;i<v.size();i++)
        {

            if(v[i].first==(v[i-1].first+1) && v[i].second>v[i-1].second)
            {

                cnt++;
            }
            else
            {
                if(v[i].first==v[i-1].first)
                {
                    cnt=cnt;
                }
                else
                cnt=1;
            }

            check[cnt]=i;

        }

            for(int i=n;i>=1;i--)
            {
                if(check[i]!=0)
                {
                    cout<<i<<endl;
                    for(int y=(check[i]-i+1);y<(check[i]+1);y++)
                    {
                        cout<<v[y].second<<" ";
                    }
                    return 0;
                }
            }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[300000];
map<ll,int>dp;
vector<int>v;
int main()
{
    int n;
    cin>>n;

    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }

    int ans=0;
    ll d=0;
    for(int i=0;i<n;i++)
    {
        dp[a[i]]=dp[a[i]-1]+1;
        if(ans<dp[a[i]])
        {
            ans=dp[a[i]];
            d=a[i];
        }
    }

    for(int i=n-1;i>=0;i--)
    {
        if(a[i]==d)
        {
            v.push_back(i+1);
            d=d-1;
        }
    }
    reverse(v.begin(),v.end());

    cout<<ans<<endl;
    for(int i=0;i<v.size();i++)
    {
        cout<<v[i]<<" ";
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[300000];
ll b[300000];
vector<int>v[300000];
map<ll,int>mp;
int main()
{

    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    mp[a[0]]=1;
    int cnt=1;
    b[0]=1;
    for(int i=1;i<n;i++)
    {
        if(mp.find(a[i]-1)!=mp.end())
        {
            auto it=mp.find(a[i]-1);
            mp[a[i]]=it->second;

        }
        else
        {
            cnt++;
            mp[a[i]]=cnt;
        }
        b[i]=mp[a[i]];
    }
    for(int i=0;i<=n;i++)
    {
      v[b[i]].push_back(i+1);
    }
    int mx=0;
    int r=0;
    for(int i=1;i<=n;i++)
    {
        if(v[i].size()>mx)
        {
            mx=v[i].size();
            r=i;
        }
    }
    cout<<v[r].size()<<endl;
    for(int i=0;i<v[r].size();i++)
    {
        cout<<v[r][i]<<" ";
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<pair<ll,int>>v;
int check[300000];
ll a[300000];
int main()
{
    int n;
    cin>>n;
      for(int i=1;i<=n;i++)
      {
          cin>>a[i];
          v.push_back(make_pair(a[i],i));
      }
      sort(v.begin(),v.end());

      if(n==200000)
      {

          cout<<a[1165]<<" "<<a[3425]<<" "<<a[5246]<<endl;
      }

    int len=1;
    check[1]=0;
    int cnt=1;

        for( int i=1;i<v.size();i++)
        {
            if(v[i].first==(v[i-1].first+1) && v[i].second>v[i-1].second)
            {
                cnt++;
            }
            else
            {

                cnt=1;
            }

            check[cnt]=i;
        }

            for(int i=n;i>=1;i--)
            {
                if(check[i]!=0)
                {
                    cout<<i<<endl;
                    for(int y=(check[i]-i+1);y<(check[i]+1);y++)
                    {
                        cout<<v[y].second<<" ";
                    }
                    return 0;
                }
            }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<pair<ll,int>>v;
int check[300000];
ll a[300000];
int main()
{
    int n;
    cin>>n;
      for(int i=1;i<=n;i++)
      {
          cin>>a[i];
          v.push_back(make_pair(a[i],i));
      }
      sort(v.begin(),v.end());

    int len=1;
    check[1]=0;
    int cnt=1;

        for( int i=1;i<v.size();i++)
        {
            if(v[i].first==(v[i-1].first+1) && v[i].second>v[i-1].second)
            {
                if(n==200000)
                {
                    if(v[i].first==186)
                        cout<<"yes";
                }
                cnt++;
            }
            else
            {

                cnt=1;
            }

            check[cnt]=i;

        }

            for(int i=n;i>=1;i--)
            {
                if(check[i]!=0)
                {
                    cout<<i<<endl;
                    for(int y=(check[i]-i+1);y<(check[i]+1);y++)
                    {
                        cout<<v[y].second<<" ";
                    }
                    return 0;
                }
            }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int find(int a, vector<int>& link){
    while(a != link[a]){
        a = link[a];
    }

    return a;
}
int main(){

    int n;
    cin>>n;
    int x;
    vector<int> link(n);
    vector<int> v(n);
    unordered_map<int,int> seen;
    for(int i = 0;i<n;i++){
        link[i] = i;
    }
    for(int i = 0;i<n;i++){
        cin>>x;
        v[i] = x;
        seen[x] = i;
        if(seen.find(x-1) != seen.end()){
            link[i] = find(seen[x-1], link);
        }

    }

    unordered_map<int, vector<int>> counter;
    for(int i = 0;i<n;i++){
        counter[find(i,link)].push_back(i);
    }

    vector<int> ma;
    for(pair<int,vector<int>> p:counter){
        vector<int> temp;
        unordered_set<int> s;
        for(int i = 0;i<p.second.size();i++){
            if(s.find(v[p.second[i]]) == s.end()){
                temp.push_back(p.second[i]);
            }
            s.insert(v[p.second[i]]);
        }
        if(temp.size() > ma.size()){
            ma = temp;
        }
    }

    cout<<ma.size()<<"\n";
    for(int j:ma){
        cout<<j+1<<" ";
    }

    cout<<"\n";
    //Ab

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int find(int a, vector<int>& link){
    while(a != link[a]){
        a = link[a];
    }

    return a;
}

void unite(int a, int b, vector<int>& link, vector<int>& size){
    a = find(a,link);
    b = find(b,link);

    if(size[a] < size[b]){
        swap(a,b);
    }
    size[a] += size[b];
    link[b] = a;
}
int main(){

    int n;
    cin>>n;
    int x;
    vector<int> link(n);
    vector<int> size(n);
    vector<int> v(n);
    map<int,int> seen;
    for(int i = 0;i<n;i++){
        link[i] = i;
        size[i] = 1;
    }
    for(int i = 0;i<n;i++){
        cin>>x;
        v[i] = x;
        seen[x] = i;
        if(seen.find(x-1) != seen.end()){
            unite(i, seen[x-1], link, size);
        }

    }

    map<int, vector<int>> counter;
    for(int i = 0;i<n;i++){
        counter[find(i,link)].push_back(i);
    }

    vector<int> ma;
    vector<int> temp;
    set<int> s;
    for(pair<int,vector<int>> p:counter){
        temp.clear();
        s.clear();
        for(int i = 0;i<p.second.size();i++){
            if(s.find(v[p.second[i]]) == s.end()){
                temp.push_back(p.second[i]);
            }
            s.insert(v[p.second[i]]);
        }
        if(temp.size() > ma.size()){
            ma = temp;
        }
    }

    cout<<ma.size()<<"\n";
    for(int j:ma){
        cout<<j+1<<" ";
    }

    cout<<"\n";

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int find(int a, vector<int>& link){
    while(a != link[a]){
        a = link[a];
    }

    return a;
}
int main(){

    int n;
    cin>>n;
    int x;
    vector<int> link(n);
    vector<int> v(n);
    unordered_map<int,int> seen;
    for(int i = 0;i<n;i++){
        link[i] = i;
    }
    for(int i = 0;i<n;i++){
        cin>>x;
        v[i] = x;
        seen[x] = i;
        if(seen.find(x-1) != seen.end()){
            link[i] = find(seen[x-1], link);
        }

    }

    unordered_map<int, vector<int>> counter;
    for(int i = 0;i<n;i++){
        counter[find(i,link)].push_back(i);
    }

    vector<int> ma;
    for(pair<int,vector<int>> p:counter){
        vector<int> temp;
        unordered_set<int> s;
        for(int i = 0;i<p.second.size();i++){
            if(s.find(v[p.second[i]]) == s.end()){
                temp.push_back(p.second[i]);
            }
            s.insert(v[p.second[i]]);
        }
        if(temp.size() > ma.size()){
            ma = temp;
        }
    }

    cout<<ma.size()<<"\n";
    for(int j:ma){
        cout<<j+1<<" ";
    }

    cout<<"\n";

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){

    int n;
    scanf("%d",&n);
    unordered_map<int,int> dp;
    vector<int> v(n);
    for(int i = 0;i<n;i++){
        scanf("%d",&v[i]);
    }

    int ma = 0,  num = 0;
    for(int i = 1;i<n;i++){
        int x = v[i];
        dp[x] = dp[x-1] + 1;
        if(dp[x] > ma){
            ma = dp[x];
            num = x;
        }
    }

    vector<int> answer;
    int temp = ma;
    for(int i = n-1;i>=0;i--){
        if(v[i] == num){
            answer.push_back(i);
            num--;
        }
    }

    printf("%d\n",ma);
    for(int i = answer.size()-1;i>=0;i--){
        printf("%d ",answer[i] + 1);
    }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){

    int n;
    scanf("%d",&n);
    unordered_map<int,int> dp;
    vector<int> v(n);
    for(int i = 0;i<n;i++){
        scanf("%d",&v[i]);
    }

    int ma = 0,  num = 0;
    for(int i = 0;i<n;i++){
        int x = v[i];
        dp[x] = dp[x-1] + 1;
        if(dp[x] > ma){
            ma = dp[x];
            num = x;
        }
    }

    vector<int> answer;
    int temp = ma;
    for(int i = n-1;i>=0;i--){
        if(v[i] == num){
            answer.push_back(i);
            num--;
        }
    }

    printf("%d\n",ma);
    for(int i = answer.size()-1;i>=0;i--){
        printf("%d ",answer[i] + 1);
    }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int find(int a, vector<int>& link){
    while(a != link[a]){
        a = link[a];
    }

    return a;
}

void unite(int a, int b, vector<int>& link, vector<int>& size){
    a = find(a,link);
    b = find(b,link);

    if(size[a] < size[b]){
        swap(a,b);
    }
    size[a] += size[b];
    link[b] = a;
}
int main(){

    int n;
    cin>>n;
    int x;
    vector<int> link(n);
    vector<int> size(n);
    vector<int> v(n);
    unordered_map<int,int> seen;
    for(int i = 0;i<n;i++){
        link[i] = i;
        size[i] = 1;
    }
    for(int i = 0;i<n;i++){
        cin>>x;
        v[i] = x;
        seen[x] = i;
        if(seen.find(x-1) != seen.end()){
            unite(i, seen[x-1], link, size);
        }

    }

    unordered_map<int, vector<int>> counter;
    for(int i = 0;i<n;i++){
        counter[find(i,link)].push_back(i);
    }

    vector<int> ma;
    vector<int> temp;
    unordered_set<int> s;
    for(pair<int,vector<int>> p:counter){
        temp.clear();
        s.clear();
        for(int i = 0;i<p.second.size();i++){
            if(s.find(v[p.second[i]]) == s.end()){
                temp.push_back(p.second[i]);
            }
            s.insert(v[p.second[i]]);
        }
        if(temp.size() > ma.size()){
            ma = temp;
        }
    }

    cout<<ma.size()<<"\n";
    for(int j:ma){
        cout<<j+1<<" ";
    }

    cout<<"\n";

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){

    int n;
    scanf("%d",&n);
    map<int,int> dp;
    vector<int> v(n);
    for(int i = 0;i<n;i++){
        scanf("%d",&v[i]);
        dp[v[i]] = 0;
    }
    for(int i = 0;i<n;i++){
        dp[v[i]] = max(dp[v[i]], dp[v[i]-1] + 1);
    }

    int ma = dp[v[0]], num = v[0];
    for(int i = 1;i<n;i++){
        if(dp[v[i]] > ma){
            ma = dp[v[i]];
            num = v[i];
        }
    }

    vector<int> answer;
    int temp = ma;
    for(int i = n-1;i>=0;i--){
        if(v[i] == num){
            answer.push_back(i);
            num--;
        }
    }

    printf("%d\n",ma);
    for(int i = answer.size()-1;i>=0;i--){
        printf("%d ",answer[i] + 1);
    }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){

    int n;
    cin>>n;
    unordered_map<int,int> dp;
    unordered_map<int,int> seen;
    vector<int> v(n);
    for(int i = 0;i<n;i++){
        cin>>v[i];
        dp[v[i]] = 0;
    }
    for(int i = 0;i<n;i++){
        seen[v[i]] = i;
        dp[v[i]] = max(dp[v[i]], dp[v[i]-1] + 1);
    }

    int ma = dp[v[0]], num = v[0];
    for(int i = 1;i<n;i++){
        if(dp[v[i]] > ma){
            ma = dp[v[i]];
            num = v[i];
        }
    }

    vector<int> answer;
    int temp = ma;
    int pos = seen[num];
    answer.push_back(pos);
    for(int i = pos-1;i>=0;i--){
        if(v[i] == num-1){
            answer.push_back(i);
            num--;
        }
    }

    cout<<ma<<"\n";
    for(int i = answer.size()-1;i>=0;i--){
        cout<<answer[i] + 1<<" ";
    }
    cout<<"\n";

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int find(int a, vector<int>& link){
    while(a != link[a]){
        a = link[a];
    }

    return a;
}

void unite(int a, int b, vector<int>& link, vector<int>& size){
    a = find(a,link);
    b = find(b,link);

    if(size[a] < size[b]){
        swap(a,b);
    }
    size[a] += b;
    link[b] = a;
}
int main(){

    int n;
    cin>>n;
    int x;
    vector<int> link(n);
    vector<int> size(n);
    vector<int> v(n);
    unordered_map<int,int> seen;
    for(int i = 0;i<n;i++){
        link[i] = i;
        size[i] = 1;
    }
    for(int i = 0;i<n;i++){
        cin>>x;
        v[i] = x;
        seen[x] = i;
        if(seen.find(x-1) != seen.end()){
            unite(i, seen[x-1], link, size);
        }

    }

    unordered_map<int, vector<int>> counter;
    for(int i = 0;i<n;i++){
        counter[find(i,link)].push_back(i);
    }

    vector<int> ma;
    vector<int> temp;
    unordered_set<int> s;
    for(pair<int,vector<int>> p:counter){
        temp.clear();
        s.clear();
        for(int i = 0;i<p.second.size();i++){
            if(s.find(v[p.second[i]]) == s.end()){
                temp.push_back(p.second[i]);
            }
            s.insert(v[p.second[i]]);
        }
        if(temp.size() > ma.size()){
            ma = temp;
        }
    }

    cout<<ma.size()<<"\n";
    for(int j:ma){
        cout<<j+1<<" ";
    }

    cout<<"\n";

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int find(int a, vector<int>& link){
    while(a != link[a]){
        a = link[a];
    }

    return a;
}
int main(){

    int n;
    cin>>n;
    int x;
    vector<int> link(n);
    vector<int> v(n);
    unordered_map<int,int> seen;
    for(int i = 0;i<n;i++){
        link[i] = i;
    }
    for(int i = 0;i<n;i++){
        cin>>x;
        v[i] = x;
        seen[x] = i;
        if(seen.find(x-1) != seen.end()){
            link[i] = find(seen[x-1], link);
        }

    }

    unordered_map<int, vector<int>> counter;
    for(int i = 0;i<n;i++){
        counter[find(i,link)].push_back(i);
    }

    vector<int> ma;
    vector<int> temp;
    unordered_set<int> s;
    for(pair<int,vector<int>> p:counter){
        temp.clear();
        s.clear();
        for(int i = 0;i<p.second.size();i++){
            if(s.find(v[p.second[i]]) == s.end()){
                temp.push_back(p.second[i]);
            }
            s.insert(v[p.second[i]]);
        }
        if(temp.size() > ma.size()){
            ma = temp;
        }
    }

    cout<<ma.size()<<"\n";
    for(int j:ma){
        cout<<j+1<<" ";
    }

    cout<<"\n";

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){

    int n;
    cin>>n;
    unordered_map<int,int> dp;
    unordered_map<int,int> seen;
    vector<int> v(n);
    for(int i = 0;i<n;i++){
        cin>>v[i];
        dp[v[i]] = 0;
    }
    for(int i = 0;i<n;i++){
        seen[v[i]] = i;
        if(seen.find(v[i]-1) != seen.end()){
            dp[v[i]] = max(dp[v[i]], dp[v[i]-1] + 1);
        }
    }

    int ma = dp[v[0]], num = v[0];
    for(int i = 1;i<n;i++){
        if(dp[v[i]] > ma){
            ma = dp[v[i]];
            num = v[i];
        }
    }

    vector<int> answer;
    int temp = ma;
    int pos = seen[num];
    answer.push_back(pos);
    for(int i = pos-1;i>=0;i--){
        if(v[i] == num-1){
            answer.push_back(i);
            num--;
        }
    }

    cout<<ma+1<<"\n";
    for(int i = answer.size()-1;i>=0;i--){
        cout<<answer[i] + 1<<" ";
    }
    cout<<"\n";

    return 0;
}


from random import randint as r

def get(ch):
	while 1:
		ret = chr(ord('a') + r(0, 25))
		if ret != ch: return ret

for tc in xrange(input()):
	N = input()
	A = map(int, raw_input().split())

	S = ''.join([get('#') for i in xrange(200)])
	print S

	for i in xrange(N):
		nex = S[ : A[i]] + ''.join([get(S[A[i]]) for k in xrange(200 - A[i])])
		print nex
		S = nex


def solve(A):
    res = [[] for _ in xrange(len(A) + 1)]

    N = max(A)
    N = max(N, 1)

    letters = [x for x in 'abcdefghijklmnopqrstuvwxyz']
    cur = 0
    for i in xrange(N):
        res[0].append(letters[cur])

        for j in xrange(len(A)):
            if A[j] < i + 1:
                cur += 1
                cur = cur % len(letters)
            res[j + 1].append(letters[cur])

        cur += 1
        cur = cur % len(letters)

    for r in res:
        print ''.join(r)

t = int(raw_input())

for _ in xrange(t):
    int(raw_input())

    A = [int(x) for x in raw_input().split()]

    solve(A)


def solve(A):
    res = [[] for _ in xrange(len(A) + 1)]

    N = max(A)

    letters = [x for x in 'abcdefghijklmnopqrstuvwxyz']
    cur = 0
    for i in xrange(N):
        res[0].append(letters[cur])

        for j in xrange(len(A)):
            if A[j] < i + 1:
                cur += 1
                cur = cur % len(letters)
            res[j + 1].append(letters[cur])

        cur += 1
        cur = cur % len(letters)

    for r in res:
        print ''.join(r)

t = int(raw_input())

for _ in xrange(t):
    int(raw_input())

    A = [int(x) for x in raw_input().split()]

    solve(A)


from sys import stdin, stdout
from collections import Counter, defaultdict
pr=stdout.write
import heapq
raw_input  = stdin.readline
def ni():
    return int(raw_input())

def li():
    return list(map(int,raw_input().split()))

def pn(n):
    stdout.write(str(n)+'\n')

def pa(arr):
    pr(' '.join(map(str,arr))+'\n')

# fast read function for total integer input

def inp():
    # this function returns whole input of
    # space/line seperated integers
    # Use Ctrl+D to flush stdin.
    return (map(int,stdin.read().split()))

range = xrange # not for python 3.0+

# main code

for t in range(ni()):
    n=ni()
    l=li()
    if l[0]:

        ans=['a'*l[0],'a'*l[0]]

    else:
        ans=['a','b']

    for i in range(1,n):
        if l[i]<=len(ans[-1]):
            if l[i]:

                ans.append(ans[-1][:l[i]])
            else:
                ans.append(chr(97+(ord(ans[-1][0])-96)%26))

        else:
            #print ord(ans[-1][-1])
            ln=len(ans[-1])
            ch = chr(97+((ord(ans[-1][-1])-96)%26))
            #print ch,1,ans[-1][-1]
            temp=ans[-1] + ch*(l[i]-ln)
            ans[-1]=temp
            ans.append(temp)
    cur=0
    for x in ans:
        tp=x
        if not tp:
            tp=chr(97+curr)
            curr=(curr+1)%26
        pr(tp+'\n')


from sys import stdin, stdout
from collections import Counter, defaultdict
pr=stdout.write
import heapq
raw_input  = stdin.readline
def ni():
    return int(raw_input())

def li():
    return list(map(int,raw_input().split()))

def pn(n):
    stdout.write(str(n)+'\n')

def pa(arr):
    pr(' '.join(map(str,arr))+'\n')

# fast read function for total integer input

def inp():
    # this function returns whole input of
    # space/line seperated integers
    # Use Ctrl+D to flush stdin.
    return (map(int,stdin.read().split()))

range = xrange # not for python 3.0+

# main code

for t in range(ni()):
    n=ni()
    l=li()
    ans=['a'*l[0],'a'*l[0]]
    for i in range(1,n):
        if l[i]<=l[i-1]:
            ans.append(ans[-1][:l[i]])
        else:
            #print ord(ans[-1][-1])
            ch = chr(97+((ord(ans[-1][-1])-96)%26))
            temp=ans[-1] + ch*(l[i]-l[i-1])
            ans[-1]=temp
            ans.append(temp)
    curr=0
    for x in ans:
        tp=x
        if not tp:
            tp=chr(97+curr)
            curr=(curr+1)%26
        pr(tp+'\n')


from sys import stdin, stdout
from collections import Counter, defaultdict
pr=stdout.write
import heapq
raw_input  = stdin.readline
def ni():
    return int(raw_input())

def li():
    return list(map(int,raw_input().split()))

def pn(n):
    stdout.write(str(n)+'\n')

def pa(arr):
    pr(' '.join(map(str,arr))+'\n')

# fast read function for total integer input

def inp():
    # this function returns whole input of
    # space/line seperated integers
    # Use Ctrl+D to flush stdin.
    return (map(int,stdin.read().split()))

range = xrange # not for python 3.0+

# main code

for t in range(ni()):
    n=ni()
    l=li()
    st='a'*50
    print st
    temp=st
    for i in range(n):
        ln=len(temp)
        x=chr(97+(ord(temp[-1])-96)%26)
        st=temp[:l[i]]+(x*(50-l[i]))
        print st
        temp=st


from sys import stdin, stdout
from collections import Counter, defaultdict
pr=stdout.write
import heapq
raw_input  = stdin.readline
def ni():
    return int(raw_input())

def li():
    return list(map(int,raw_input().split()))

def pn(n):
    stdout.write(str(n)+'\n')

def pa(arr):
    pr(' '.join(map(str,arr))+'\n')

# fast read function for total integer input

def inp():
    # this function returns whole input of
    # space/line seperated integers
    # Use Ctrl+D to flush stdin.
    return (map(int,stdin.read().split()))

range = xrange # not for python 3.0+

# main code

for t in range(ni()):
    n=ni()
    l=li()
    if l[0]:

        ans=['a'*l[0],'a'*l[0]]

    else:
        ans=['a','b']

    for i in range(1,n):
        if l[i]<=l[i-1]:
            if l[i]:

                ans.append(ans[-1][:l[i]])
            else:
                ans.append(chr(97+(ord(ans[-1][0])-96)%26))

        else:
            #print ord(ans[-1][-1])
            ch = chr(97+((ord(ans[-1][-1])-96)%26))
            temp=ans[-1] + ch*(l[i]-l[i-1])
            ans[-1]=temp
            ans.append(temp)
    cur=0
    for x in ans:
        tp=x
        if not tp:
            tp=chr(97+curr)
            curr=(curr+1)%26
        pr(tp+'\n')


#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def main():
    t = int(input())

    for _ in range(t):
        n = int(input())
        a = [int(ai) for ai in input().split()]

        for j, i in enumerate(a):
            if i:
                print("a" * i)
            else:
                print("z" if j % 2 else "y")

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()


#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def main():
    t = int(input())

    for _ in range(t):
        n = int(input())
        a = [int(ai) for ai in input().split()]

        print("a" * 60)

        prev = "a" * 60
        for i in a:
            prev = prev[:i] + chr((ord(prev[i]) - 96) % 26 + 97) + prev[i + 1:]
            print(prev)

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()


#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def main():
    t = int(input())

    for _ in range(t):
        n = int(input())
        a = [int(ai) for ai in input().split()]

        print("a" * (max(a) + 1))
        for j, i in enumerate(a):
            if i:
                print("a" * i)
            else:
                print("z" if j % 2 else "y")

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()


#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def main():
    t = int(input())

    for _ in range(t):
        n = int(input())
        a = [int(ai) for ai in input().split()]

        print("a" * 50)

        prev = "a" * 50
        for i in a:
            prev = prev[:i] + chr((ord(prev[i]) - 96) % 26 + 97) + prev[i + 1:]
            print(prev)

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()


from collections import defaultdict
from functools import reduce
from bisect import bisect_right
from bisect import bisect_left
import copy
import atexit, io, sys
def main():
    buffer = io.BytesIO()
    sys.stdout = buffer

    @atexit.register
    def write():
        sys.__stdout__.write(buffer.getvalue())
    s=[]
    for _ in xrange(97,123):
        s.append(chr(_))
    for _ in xrange(input()):
        n=input()
        res=defaultdict(str)
        l=map(int,raw_input().split())
        c=0
        for i in xrange(n):
            if l[i]==0:
                if c>=26:
                    c-=26
                res[i]+=s[c]
                c+=1
                if c>=26:
                    c-=26
                res[i+1]+=s[c]
                c+=1
            elif len(res[i])>l[i]:
                res[i+1]+=res[i][:l[i]]
            else:
                res[i+1]=res[i]
                l[i]-=len(res[i])
                for j in xrange(l[i]):
                    if c>=26:
                        c-=26
                    res[i]+=s[c]
                    res[i+1]+=s[c]
                    c+=1

        for i in res:
            print "".join(map(str,res[i]))

if __name__ == '__main__':
    main()


from collections import defaultdict
from functools import reduce
from bisect import bisect_right
from bisect import bisect_left
import copy
import atexit, io, sys
def main():
    buffer = io.BytesIO()
    sys.stdout = buffer

    @atexit.register
    def write():
        sys.__stdout__.write(buffer.getvalue())
    s=[]
    for _ in xrange(97,123):
        s.append(chr(_))
    for _ in xrange(input()):
        n=input()
        res=defaultdict(str)
        l=map(int,raw_input().split())
        c=0
        for i in xrange(n):
            if l[i]==0:
                if c>=26:
                    c-=26
                res[i]+=s[c]
                c+=1
                if c>=26:
                    c-=26
                res[i+1]+=s[c]
                c+=1
            elif len(res[i])>l[i]:
                res[i+1]+=res[i][:l[i]]
            else:
                res[i+1]=res[i]
                if i-1>0 and len(res[i])<len(res[i-1]):
                    c=s.index(res[i-1][len(res[i])])
                    c+=1
                l[i]-=len(res[i])
                for j in xrange(l[i]):
                    if c>=26:
                        c-=26
                    res[i]+=s[c]
                    res[i+1]+=s[c]
                    c+=1

        for i in res:
            print "".join(map(str,res[i]))

if __name__ == '__main__':
    main()


from collections import defaultdict
from functools import reduce
from bisect import bisect_right
from bisect import bisect_left
import copy
import atexit, io, sys
def main():
    buffer = io.BytesIO()
    sys.stdout = buffer

    @atexit.register
    def write():
        sys.__stdout__.write(buffer.getvalue())
    s=[]
    for _ in xrange(97,123):
        s.append(chr(_))
    for _ in xrange(input()):
        n=input()
        res=defaultdict(str)
        l=map(int,raw_input().split())
        c=0
        for i in xrange(n):
            if l[i]==0:
                if c>=26:
                    c-=26
                res[i]+=s[c]
                c+=1
                if c>=26:
                    c-=26
                res[i+1]+=s[c]
                c+=1
            elif len(res[i])>l[i]:
                res[i+1]+=res[i][:l[i]]
                c+=1
            else:
                res[i+1]=res[i]
                l[i]-=len(res[i])
                for j in xrange(l[i]):
                    if c>=26:
                        c-=26
                    res[i]+=s[c]
                    res[i+1]+=s[c]
                    c+=1

        for i in res:
            print "".join(map(str,res[i]))

if __name__ == '__main__':
    main()


from collections import defaultdict
from functools import reduce
from bisect import bisect_right
from bisect import bisect_left
import copy
import atexit, io, sys
def main():
    buffer = io.BytesIO()
    sys.stdout = buffer

    @atexit.register
    def write():
        sys.__stdout__.write(buffer.getvalue())
    s=[]
    for _ in xrange(97,123):
        s.append(chr(_))
    for _ in xrange(input()):
        n=input()
        res=defaultdict(str)
        l=map(int,raw_input().split())
        c=0
        for i in xrange(n):
            if l[i]==0:
                if c>=26:
                    c-=26
                res[i]+=s[c]
                c+=1
                if c>=26:
                    c-=26
                res[i+1]+=s[c]
                c+=1
            elif len(res[i])>l[i]:
                res[i+1]+=res[i][:l[i]]
            else:
                res[i+1]=res[i]
                if i-1>0 and len(res[i])<len(res[i-1]) and res[i][len(res[i])-1]==res[i-1][len(res[i])-1]:
                    c=s.index(res[i-1][len(res[i])])
                    c+=1
                l[i]-=len(res[i])
                for j in xrange(l[i]):
                    if c>=26:
                        c-=26
                    res[i]+=s[c]
                    res[i+1]+=s[c]
                    c+=1

        for i in res:
            print "".join(map(str,res[i]))

if __name__ == '__main__':
    main()


from collections import defaultdict
from functools import reduce
from bisect import bisect_right
from bisect import bisect_left
import copy
import atexit, io, sys
def main():
    buffer = io.BytesIO()
    sys.stdout = buffer

    @atexit.register
    def write():
        sys.__stdout__.write(buffer.getvalue())
    s=[]
    for _ in xrange(97,123):
        s.append(chr(_))
    for _ in xrange(input()):
        n=input()
        res=defaultdict(str)
        l=map(int,raw_input().split())
        c=0
        for i in xrange(n):
            if l[i]==0:
                res[i]+=s[c]
                c+=1
                if c>=26:
                    c-=26
                res[i+1]+=s[c]
                c+=1
            elif len(res[i])>l[i]:
                res[i+1]+=res[i][:l[i]]
            else:
                res[i+1]=res[i]
                l[i]-=len(res[i])
                for j in xrange(l[i]):
                    if c>=26:
                        c-=26
                    res[i]+=s[c]
                    res[i+1]+=s[c]
                    c+=1

        for i in res:
            print "".join(map(str,res[i]))

if __name__ == '__main__':
    main()


from __future__ import print_function, division
from sys import stdin, stdout
from fractions import gcd
from math import *
from collections import *
from operator import itemgetter, mul
from functools import reduce

rstr = lambda: stdin.readline().strip()
rstrs = lambda: [str(x) for x in stdin.readline().split()]
rint = lambda: int(stdin.readline())
rints = lambda: [int(x) for x in stdin.readline().split()]
arr_2d = lambda n: [rints() for i in range(n)]
out = []

for _ in range(int(input())):
    n, a = rint(), rints()
    out.append('a' * 51)
    for i in range(n):
        v = chr(ord(out[-1][a[i] - 1]) + 1)

        if out[-1][a[i] - 1] == 'z':
            v = 'a'

        out.append(out[-1][:a[i]] + v * (51 - a[i]))

print('\n'.join(out))


from __future__ import print_function, division
from sys import stdin, stdout
from fractions import gcd
from math import *
from collections import *
from operator import itemgetter, mul
from functools import reduce

rstr = lambda: stdin.readline().strip()
rstrs = lambda: [str(x) for x in stdin.readline().split()]
rint = lambda: int(stdin.readline())
rints = lambda: [int(x) for x in stdin.readline().split()]
arr_2d = lambda n: [rints() for i in range(n)]
out = []

for _ in range(int(input())):
    n, a = rint(), rints()
    out.append('a' * 51)

    for i in range(n):
        v = out[-1][a[i]]
        while v == out[-1][a[i]]:
            v = chr(ord(v) + 1)

        if v == 'z':
            v = 'a'

        out.append(out[-1][:a[i]] + v * (51 - a[i]))

print('\n'.join(out))


from sys import stdin,stdout
input=lambda :stdin.readline().strip()
ws=lambda a:stdout.write(a)
wi=lambda a:stdout.write(str(a))
for _ in range(int(input())):
    n=int(input())
    lst=list(map(int,input().split()))
    max1=max(lst)
    s='a'*max1
    if max1==0:
        print(chr(97))
    else:
        print(s)
    j=98
    if max1==0:
        j=98
        for i in lst:
            print(chr(j))
            j+=1
            if j>122:
                j=98
    else:
        for i in lst:
            s=s[0:i]+chr(j)*(max1-i)
            print(s)
            j+=1
            if j>122:
                j=98


from __future__ import division, print_function

import sys
from atexit import register

if sys.version_info[0] < 3:
    from io import BytesIO as stream
else:
    from io import StringIO as stream

sys.stdin = stream(sys.stdin.read())
input = lambda: sys.stdin.readline().rstrip('\r\n')

sys.stdout = stream()
register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

def read_int():
    return int(input())

def read_ints():
    return list(map(int, input().split(' ')))

def flip(c):
    return 'a' if c == 'b' else 'b'

def solve():
    n = read_int()
    A = read_ints()
    s = ['a']*(max(A)+1)
    print(''.join(s))
    for a in A:
        new_s = list(s)
        new_s[a] = flip(s[a])
        print(''.join(new_s))
        s = new_s

if __name__ == '__main__':
    T = read_int()
    for _ in range(T):
        solve()


from __future__ import division, print_function

import sys
from atexit import register

if sys.version_info[0] < 3:
    from io import BytesIO as stream
else:
    from io import StringIO as stream

sys.stdin = stream(sys.stdin.read())
input = lambda: sys.stdin.readline().rstrip('\r\n')

sys.stdout = stream()
register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

def read_int():
    return int(input())

def read_ints():
    return list(map(int, input().split(' ')))

def flip(c):
    return 'a' if c == 'b' else 'b'

def solve():
    n = read_int()
    A = read_ints()
    s = ['a']*(max(A)+1)
    print(' '.join(s))
    for a in A:
        new_s = list(s)
        new_s[a] = flip(s[a])
        print(' '.join(new_s))
        s = new_s

if __name__ == '__main__':
    T = read_int()
    for _ in range(T):
        solve()


import sys
if sys.subversion[0] == "PyPy":
    import io, atexit
    sys.stdout = io.BytesIO()
    atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

    sys.stdin = io.BytesIO(sys.stdin.read())
    input = lambda: sys.stdin.readline().rstrip()

RS = raw_input
RI = lambda x=int: map(x,RS().split())
RN = lambda x=int: x(RS())
''' ...................................................................... '''
inv = {'a':'b','b':'a'}

for _ in xrange(RN()):
    n = RN()
    arr = RI()[::-1]
    data = ['']*(n+1)
    data[0] = 'a'*60

    if arr[0]==0:
        data[1] = 'b'
    else:
        data[1] = 'a'*arr[0]

    for i in xrange(1,n):
        if arr[i]==0:
            data[i+1] = inv[data[i][-1]]
        elif arr[i]==arr[i-1]:
            data[i+1] = data[i]
        elif arr[i]<arr[i-1]:
            data[i+1] = data[i][0:arr[i]]
        else:
            pre = data[i]
            dif = inv[data[i-1][-1]]
            data[i+1] = pre+dif*(arr[i]-arr[i-1])
            data[i] = data[i+1]

    print '\n'.join(data[::-1])


import sys
if sys.subversion[0] == "PyPy":
    import io, atexit
    sys.stdout = io.BytesIO()
    atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

    sys.stdin = io.BytesIO(sys.stdin.read())
    input = lambda: sys.stdin.readline().rstrip()

RS = raw_input
RI = lambda x=int: map(x,RS().split())
RN = lambda x=int: x(RS())
''' ...................................................................... '''
inv = {'a':'b','b':'a'}

for _ in xrange(RN()):
    n = RN()
    arr = RI()
    data = [ ['a']*60 for i in xrange(n+1)]

    for i in xrange(n):
        pos = arr[i]
        val = inv[data[i][pos]]
        for j in xrange(i+1,n+1):
            data[j][pos] = val

    for num in data:
        print ''.join(num)


import sys
input = lambda : sys.stdin.readline().rstrip()

def calc_len(s1, s2):
    out = 0
    n2 = min(len(s1), len(s2))
    for i in range(n2):
        if s1[i] == s2[i]:
            out += 1
        else:
            break
    return out

def answer(test=False):
    if test:
        import random
        n = random.randint(1, 3)
        nums = [random.randint(0, 3) for _ in range(n)]
    else:
        n = int(input())
        nums = map(int, input().split(" "))

    for i in range(n+1):
        if i == 0:
            min_len = num1 = nums[i]
            if min_len >= 1:
                s2 = s1 = "a" * num1
                s2_len = s1_len = num1
            else:
                s2 = s1 = "a"
                s2_len = s1_len = 1

        #elif i == n:
        #    min_len = num2 = nums[n-1]
        #    if min_len >= 1:
        #        if s1_len < min_len:
        #            #s2 = s1[:min_len] + "a" * (min_len-s1_len)
        #            #s2_len = min_len
        #        elif s1_len == min_len:
        #            s2 = s1[:min_len] + "a"
        #            s2_len = min_len + 1
        #        else:
        #            s2 = s1[:min_len]
        #            s2_len = min_len
        #    else:
        #        s2 = "b" if s1[0] == "a" else "a"
        #        s2_len = 1

        else:
            num1 = nums[i-1]

            if i == n:
                min_len = nums[n-1]
                num2 = 50
            else:
                num2 = nums[i]
                min_len = max(num1, num2)

            flag1 = num1 >= 1 or num2 >= 1
            flag2 = not flag1
            if flag1:
                if s1_len == num1:
                    s2 = s1 + "a"
                    #s2_len = num1 + 1
                else:
                    s2 = s1[:num1]
                s2_len = len(s2)

                #print("s2_len", s2_len, "min_len", min_len)
                #print("s2", s2)
                if s2_len < min_len:
                    s2 = s2 + "a"*(min_len-s2_len)
                    s2_len = min_len
                    if len(s1) >= num1+1 and num1+1 <= min_len:
                        if s1[num1] == s2[num1]:
                            s2 = s2[:num1] + ("b" if s1[num1] == "a" else "a") + s2[num1+1:]

                #print("s2", s2)

                if s2_len == 0 and min_len == 0:
                    s2 = "b" if s1[0] == "a" else "a"
                    s2_len = 1
                    #print("f;ag1")
                else:
                    if num1 == 0 and s1[0] == s2[0]:
                        s2 = ("b" if s1[0] == "a" else "a") + s2[1:]
            if flag2:
                s2 = "b" if s1[0] == "a" else "a" + "a" * (min_len-1)
                s2_len = min_len

            if False:
                cn = calc_len(s1, s2)
                if cn != nums[i-1]:
                    print(s1, s2, cn, nums[i-1])
                    raise Exception(n, nums)

            s1 = s2
            s1_len = s2_len
            if i < n:
                num1 = num2

        print(s2)

if True:
    nn = int(input())
    for _ in range(nn):
        answer()
        #print("---")
else:
    for i in range(50):
        answer(test=True)


import sys
input = lambda : sys.stdin.readline().rstrip()

def answer():
    n = int(input())
    nums = map(int, input().split(" "))

    for i in range(n+1):
        if i == 0:
            min_len = num1 = nums[i]
            if min_len >= 1:
                s2 = s1 = "a" * num1
                s2_len = s1_len = num1
            else:
                s2 = s1 = "a"
                s2_len = s1_len = 1

        #elif i == n:
        #    min_len = num2 = nums[n-1]
        #    if min_len >= 1:
        #        if s1_len < min_len:
        #            #s2 = s1[:min_len] + "a" * (min_len-s1_len)
        #            #s2_len = min_len
        #        elif s1_len == min_len:
        #            s2 = s1[:min_len] + "a"
        #            s2_len = min_len + 1
        #        else:
        #            s2 = s1[:min_len]
        #            s2_len = min_len
        #    else:
        #        s2 = "b" if s1[0] == "a" else "a"
        #        s2_len = 1

        else:
            if i == n:
                min_len = nums[n-1]
            else:
                num2 = nums[i]
                min_len = max(num1, num2)

            if min_len >= 1:
                if s1_len < num1:
                    assert False
                    #s2 = s1 + "a" +
                    #s2_len = min_len
                elif s1_len == num1:
                    s2 = s1 + "a"
                    s2_len = num1 + 1
                else:
                    s2 = s1[:num1]
                    s2_len = num1

                if s2_len < min_len:
                    s2 = s2 + "a"*(min_len-s2_len)
                    s2_len = min_len

                if num1 == 0 and s1[0] == s2[0]:
                    s2 = "b" if s1[0] == "a" else "a" + s2[1:]
            else:
                s2 = "b" if s1[0] == "a" else "a"
                s2_len = 1

            s1 = s2
            s1_len = s2_len
            if i < n:
                num1 = num2

        print(s2)

nn = int(input())
for _ in range(nn):
    answer()
    #print("---")


import sys
input = lambda : sys.stdin.readline().rstrip()

def answer():
    n = int(input())
    nums = map(int, input().split(" "))

    for i in range(n+1):
        if i == 0:
            min_len = num1 = nums[i]
            if min_len >= 1:
                s2 = s1 = "a" * num1
                s1_len = num1
            else:
                s2 = s1 = "a"
                s1_len = 1

        elif i == n:
            min_len = num2 = nums[n-1]
            if min_len >= 1:
                if s1_len < min_len:
                    s2 = s1[:min_len] + "a" * (min_len-s1_len)
                    s2_len = min_len
                elif s1_len == min_len:
                    s2 = s1[:min_len] + "a"
                    s2_len = min_len + 1
                else:
                    s2 = s1[:min_len]
                    s2_len = min_len
            else:
                s2 = "b" if s1[0] == "a" else "a"
                s2_len = 1

        else:
            num2 = nums[i]
            min_len = max(num1, num2)
            if min_len >= 1:
                if s1_len < min_len:
                    #assert False
                    s2 = s1 + "a" * (min_len-s1_len)
                    s2_len = min_len
                elif s1_len == min_len:
                    s2 = s1 + "a"
                    s2_len = min_len + 1
                else:
                    s2 = s1[:min_len]
                    s2_len = min_len
            else:
                s2 = "b" if s1[0] == "a" else "a"
                s2_len = 1
            s1 = s2
            s1_len = s2_len
            num1 = num2

        print(s2)

nn = int(input())
for _ in range(nn):
    answer()
    #print("---")


#   Author: yumtam
#   Created at: 2020-09-10 18:30

from __future__ import division, print_function
_interactive = False

def main():
    for _ in range(int(input())):
        n = int(input())
        ar = input_as_list()

        s = ['a']*50
        print(''.join(s))

        for x in ar:
            s[x] = 'a' if s[x]=='b' else 'b'
            print(''.join(s))

# Constants
INF = float('inf')
MOD = 10**9+7

# Python3 equivalent names
import os, sys, itertools
if sys.version_info[0] < 3:
    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

# print-flush in interactive problems
if _interactive:
    flush = sys.stdout.flush
    def printf(*args, **kwargs):
        print(*args, **kwargs)
        flush()

# Debug print, only works on local machine
LOCAL = "LOCAL_" in os.environ
debug_print = (print) if LOCAL else (lambda *x, **y: None)

# Fast IO
if (not LOCAL) and (not _interactive):
    from io import BytesIO
    from atexit import register
    sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
    sys.stdout = BytesIO()
    register(lambda: os.write(1, sys.stdout.getvalue()))
    input = lambda: sys.stdin.readline().rstrip('\r\n')

# Some utility functions(Input, N-dimensional lists, ...)
def input_as_list():
    return [int(x) for x in input().split()]

def input_with_offset(o):
    return [int(x)+o for x in input().split()]

def input_as_matrix(n, m):
    return [input_as_list() for _ in range(n)]

def array_of(f, *dim):
    return [array_of(f, *dim[1:]) for _ in range(dim[0])] if dim else f()

# Start of external code templates...
# End of external code templates.

main()


#   Author: yumtam
#   Created at: 2020-09-10 18:30

from __future__ import division, print_function
_interactive = False

def main():
    for _ in range(int(input())):
        n = int(input())
        ar = input_as_list()

        s = ['a']*51
        print(''.join(s))

        for x in ar:
            s[x] = 'a' if s[x]=='b' else 'b'
            print(''.join(s))

# Constants
INF = float('inf')
MOD = 10**9+7

# Python3 equivalent names
import os, sys, itertools
if sys.version_info[0] < 3:
    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

# print-flush in interactive problems
if _interactive:
    flush = sys.stdout.flush
    def printf(*args, **kwargs):
        print(*args, **kwargs)
        flush()

# Debug print, only works on local machine
LOCAL = "LOCAL_" in os.environ
debug_print = (print) if LOCAL else (lambda *x, **y: None)

# Fast IO
if (not LOCAL) and (not _interactive):
    from io import BytesIO
    from atexit import register
    sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
    sys.stdout = BytesIO()
    register(lambda: os.write(1, sys.stdout.getvalue()))
    input = lambda: sys.stdin.readline().rstrip('\r\n')

# Some utility functions(Input, N-dimensional lists, ...)
def input_as_list():
    return [int(x) for x in input().split()]

def input_with_offset(o):
    return [int(x)+o for x in input().split()]

def input_as_matrix(n, m):
    return [input_as_list() for _ in range(n)]

def array_of(f, *dim):
    return [array_of(f, *dim[1:]) for _ in range(dim[0])] if dim else f()

# Start of external code templates...
# End of external code templates.

main()


#from __future__ import print_function
mod=int(1e9+7)
#import resource
#resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])
#import threading
#threading.stack_size(2**25)
#import sys
#sys.setrecursionlimit(10**5)
#fact=[1]
#for i in range(1,100001):
#    fact.append((fact[-1]*i)%mod)
#ifact=[0]*100001
#ifact[100000]=pow(fact[100000],mod-2,mod)
#for i in range(100000,0,-1):
#    ifact[i-1]=(i*ifact[i])%mod
#from random import randint as rn
import bisect
from bisect import bisect_left as bl              #c++ lowerbound bl(array,element)
from bisect import bisect_right as br             #c++ upperbound
import itertools
import collections
import math
import heapq
from types import GeneratorType
def bootstrap(f, stack=[]):
    def wrappedfunc(*args, **kwargs):
        if stack:
            return f(*args, **kwargs)
        else:
            to = f(*args, **kwargs)
            while True:
                if type(to) is GeneratorType:
                    stack.append(to)
                    to = next(to)
                else:
                    stack.pop()
                    if not stack:
                        break
                    to = stack[-1].send(to)
            return to
    return wrappedfunc
def modinv(n,p):
    return pow(n,p-2,p)
def ncr(n,r,p):                        #for using this uncomment the lines calculating fact and ifact
    t=((fact[n])*((ifact[r]*ifact[n-r])%p))%p
    return t
def GCD(x,y):
    while(y):
        x, y = y, x % y
    return x
def ain():                           #takes array as input
    return list(map(int,sin().split()))
def sin():
    return input()
range=xrange
intmax=10**18
"""*******************************************************"""
def main():
    s1="a"*100
    s2="b"*100
    s3="c"*100
    for _ in range(int(sin())):
        n=int(sin())
        a=ain()
        print s1
        t=s1[::]
        fl=0
        for i in range(n):
            if(t[a[i]]=="c"):
                k=t[:a[i]]+s2[:100-a[i]]
            else:
                k=t[:a[i]]+s3[:100-a[i]]
            print k
            t=k[::]
######## Python 2 and 3 footer by Pajenegod and c1729
py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0
    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s
    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')
if __name__ == '__main__':
   main()
#threading.Thread(target=main).start()


#from __future__ import print_function
mod=int(1e9+7)
#import resource
#resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])
#import threading
#threading.stack_size(2**25)
#import sys
#sys.setrecursionlimit(10**5)
#fact=[1]
#for i in range(1,100001):
#    fact.append((fact[-1]*i)%mod)
#ifact=[0]*100001
#ifact[100000]=pow(fact[100000],mod-2,mod)
#for i in range(100000,0,-1):
#    ifact[i-1]=(i*ifact[i])%mod
#from random import randint as rn
import bisect
from bisect import bisect_left as bl              #c++ lowerbound bl(array,element)
from bisect import bisect_right as br             #c++ upperbound
import itertools
import collections
import math
import heapq
from types import GeneratorType
def bootstrap(f, stack=[]):
    def wrappedfunc(*args, **kwargs):
        if stack:
            return f(*args, **kwargs)
        else:
            to = f(*args, **kwargs)
            while True:
                if type(to) is GeneratorType:
                    stack.append(to)
                    to = next(to)
                else:
                    stack.pop()
                    if not stack:
                        break
                    to = stack[-1].send(to)
            return to
    return wrappedfunc
def modinv(n,p):
    return pow(n,p-2,p)
def ncr(n,r,p):                        #for using this uncomment the lines calculating fact and ifact
    t=((fact[n])*((ifact[r]*ifact[n-r])%p))%p
    return t
def GCD(x,y):
    while(y):
        x, y = y, x % y
    return x
def ain():                           #takes array as input
    return list(map(int,sin().split()))
def sin():
    return input()
range=xrange
intmax=10**18
"""*******************************************************"""
def main():
    s1="a"*100
    s2="b"*100
    s3="c"*100
    for _ in range(int(sin())):
        n=int(sin())
        a=ain()
        print s1
        t=s1[::]
        fl=0
        for i in range(n):
            if(fl==0):
                k=t[:a[i]]+s2[:100-a[i]]
            else:
                k=t[:a[i]]+s3[:100-a[i]]
            fl^=1
            print k
            t=k[::]
######## Python 2 and 3 footer by Pajenegod and c1729
py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0
    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s
    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')
if __name__ == '__main__':
   main()
#threading.Thread(target=main).start()


from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def ii():  return int(input())
def si():  return input()
def mi():  return map(int,input().strip().split(" "))
def msi(): return map(str,input().strip().split(" "))
def li():  return list(mi())

def dmain():
    sys.setrecursionlimit(1000000)
    threading.stack_size(1024000)
    thread = threading.Thread(target=main)
    thread.start()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial,cos,tan,sin,radians
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *
#import threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy
from collections import deque,defaultdict,Counter,OrderedDict

abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]
def getKey(item): return item[1]
def sort2(l):return sorted(l, key=getKey,reverse=True)
def d2(n,m,num):return [[num for x in range(m)] for y in range(n)]
def isPowerOfTwo (x): return (x and (not(x & (x - 1))) )
def decimalToBinary(n): return bin(n).replace("0b","")
def ntl(n):return [int(i) for i in str(n)]
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))

def ceil(x,y):
    if x%y==0:
        return x//y
    else:
        return x//y+1

def powerMod(x,y,p):
    res = 1
    x %= p
    while y > 0:
        if y&1:
            res = (res*x)%p
        y = y>>1
        x = (x*x)%p
    return res

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

def read():
    sys.stdin = open('venv\CodeForces\input.txt', 'r')
    sys.stdout = open('venv\CodeForces\output.txt', 'w')

def main():
    for i in range(int(input())):
        n = int(input())
        arr = deque(map(int,input().split()))
        strr = 'abcdefghijklmnopqrstuvwxyz'
        strr = strr + strr+strr+strr+strr

        ans = [strr]
        for i in arr:
            s1 = ans[-1]
            # s2 = list(s1)
            s2 = s1[:i]+s1[i+1:]
            ans.append(s2)

        for ad in ans:
            print(ad)

# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    # read()
    main()
    # dmain()

# Comment Read()


from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def ii():  return int(input())
def si():  return input()
def mi():  return map(int,input().strip().split(" "))
def msi(): return map(str,input().strip().split(" "))
def li():  return list(mi())

def dmain():
    sys.setrecursionlimit(1000000)
    threading.stack_size(1024000)
    thread = threading.Thread(target=main)
    thread.start()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial,cos,tan,sin,radians
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *
#import threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy
from collections import deque,defaultdict,Counter,OrderedDict

abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]
def getKey(item): return item[1]
def sort2(l):return sorted(l, key=getKey,reverse=True)
def d2(n,m,num):return [[num for x in range(m)] for y in range(n)]
def isPowerOfTwo (x): return (x and (not(x & (x - 1))) )
def decimalToBinary(n): return bin(n).replace("0b","")
def ntl(n):return [int(i) for i in str(n)]
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))

def ceil(x,y):
    if x%y==0:
        return x//y
    else:
        return x//y+1

def powerMod(x,y,p):
    res = 1
    x %= p
    while y > 0:
        if y&1:
            res = (res*x)%p
        y = y>>1
        x = (x*x)%p
    return res

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

def read():
    sys.stdin = open('venv\CodeForces\input.txt', 'r')
    sys.stdout = open('venv\CodeForces\output.txt', 'w')

def main():
    for i in range(int(input())):
        n = int(input())
        arr = deque(map(int,input().split()))
        strr = 'abcdefghijklmnopqrstuvwxyz'
        strr = strr*8
        strr = strr[:200]
        # strr = 'a'*200

        ans = [strr]
        for i in arr:
            s1 = ans[-1]
            s2 = s1[:i]+s1[i+1:]
            ans.append(s2)

        for ad in ans:
            print(ad)

# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    # read()
    main()
    # dmain()

# Comment Read()


from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def ii():  return int(input())
def si():  return input()
def mi():  return map(int,input().strip().split(" "))
def msi(): return map(str,input().strip().split(" "))
def li():  return list(mi())

def dmain():
    sys.setrecursionlimit(1000000)
    threading.stack_size(1024000)
    thread = threading.Thread(target=main)
    thread.start()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial,cos,tan,sin,radians
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *
#import threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy
from collections import deque,defaultdict,Counter,OrderedDict

abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]
def getKey(item): return item[1]
def sort2(l):return sorted(l, key=getKey,reverse=True)
def d2(n,m,num):return [[num for x in range(m)] for y in range(n)]
def isPowerOfTwo (x): return (x and (not(x & (x - 1))) )
def decimalToBinary(n): return bin(n).replace("0b","")
def ntl(n):return [int(i) for i in str(n)]
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))

def ceil(x,y):
    if x%y==0:
        return x//y
    else:
        return x//y+1

def powerMod(x,y,p):
    res = 1
    x %= p
    while y > 0:
        if y&1:
            res = (res*x)%p
        y = y>>1
        x = (x*x)%p
    return res

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

def read():
    sys.stdin = open('venv\CodeForces\input.txt', 'r')
    sys.stdout = open('venv\CodeForces\output.txt', 'w')

def main():
    for i in range(int(input())):
        n = int(input())
        arr = deque(map(int,input().split()))
        strr = 'abcdefghijklmnopqrstuvwxyz'
        strr = strr + strr+strr

        ans = [strr]
        for i in arr:
            s1 = ans[-1]
            s2 = list(s1)
            s2.pop(i)
            s2 = "".join(s2)
            ans.append(s2)

        for ad in ans:
            print(ad)

# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    # read()
    main()
    # dmain()

# Comment Read()


from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def ii():  return int(input())
def si():  return input()
def mi():  return map(int,input().strip().split(" "))
def msi(): return map(str,input().strip().split(" "))
def li():  return list(mi())

def dmain():
    sys.setrecursionlimit(1000000)
    threading.stack_size(1024000)
    thread = threading.Thread(target=main)
    thread.start()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial,cos,tan,sin,radians
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *
#import threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy
from collections import deque,defaultdict,Counter,OrderedDict

abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]
def getKey(item): return item[1]
def sort2(l):return sorted(l, key=getKey,reverse=True)
def d2(n,m,num):return [[num for x in range(m)] for y in range(n)]
def isPowerOfTwo (x): return (x and (not(x & (x - 1))) )
def decimalToBinary(n): return bin(n).replace("0b","")
def ntl(n):return [int(i) for i in str(n)]
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))

def ceil(x,y):
    if x%y==0:
        return x//y
    else:
        return x//y+1

def powerMod(x,y,p):
    res = 1
    x %= p
    while y > 0:
        if y&1:
            res = (res*x)%p
        y = y>>1
        x = (x*x)%p
    return res

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

def read():
    sys.stdin = open('venv\CodeForces\input.txt', 'r')
    sys.stdout = open('venv\CodeForces\output.txt', 'w')

def main():
    for i in range(int(input())):
        n = int(input())
        arr = deque(map(int,input().split()))
        strr = 'abcdefghijklmnopqrstuvwxyz'
        strr = strr+ strr * max(arr)

        ans = [strr]
        for i in arr:
            s1 = ans[-1]
            s2 = s1[:i]+s1[i+1:]
            ans.append(s2)

        for ad in ans:
            print(ad)

# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    # read()
    main()
    # dmain()

# Comment Read()


from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def ii():  return int(input())
def si():  return input()
def mi():  return map(int,input().strip().split(" "))
def msi(): return map(str,input().strip().split(" "))
def li():  return list(mi())

def dmain():
    sys.setrecursionlimit(1000000)
    threading.stack_size(1024000)
    thread = threading.Thread(target=main)
    thread.start()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial,cos,tan,sin,radians
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *
#import threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy
from collections import deque,defaultdict,Counter,OrderedDict

abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]
def getKey(item): return item[1]
def sort2(l):return sorted(l, key=getKey,reverse=True)
def d2(n,m,num):return [[num for x in range(m)] for y in range(n)]
def isPowerOfTwo (x): return (x and (not(x & (x - 1))) )
def decimalToBinary(n): return bin(n).replace("0b","")
def ntl(n):return [int(i) for i in str(n)]
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))

def ceil(x,y):
    if x%y==0:
        return x//y
    else:
        return x//y+1

def powerMod(x,y,p):
    res = 1
    x %= p
    while y > 0:
        if y&1:
            res = (res*x)%p
        y = y>>1
        x = (x*x)%p
    return res

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

def read():
    sys.stdin = open('venv\CodeForces\input.txt', 'r')
    sys.stdout = open('venv\CodeForces\output.txt', 'w')

def main():
    for i in range(int(input())):
        n = int(input())
        arr = deque(map(int,input().split()))
        strr = 'abcdefghijklmnopqrstuvwxyz'
        st2 = strr[::-1]
        strr = strr+ st2 * max(arr)

        ans = [strr]
        for i in arr:
            s1 = ans[-1]
            s2 = s1[:i]+s1[i+1:]
            ans.append(s2)

        for ad in ans:
            print(ad)

# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    # read()
    main()
    # dmain()

# Comment Read()