Problem: This week Arkady wanted to cook some pancakes (to follow ancient traditions) and make a problem about that. But then he remembered that one can't make a problem about stacking pancakes without working at a specific IT company, so he decided to bake the Napoleon cake instead.

To bake a Napoleon cake, one has to bake n dry layers first, and then put them on each other in one stack, adding some cream. Arkady started with an empty plate, and performed the following steps n times: 

  * place a new cake layer on the top of the stack; 
  * after the i-th layer is placed, pour a_i units of cream on top of the stack. 



When x units of cream are poured on the top of the stack, top x layers of the cake get drenched in the cream. If there are less than x layers, all layers get drenched and the rest of the cream is wasted. If x = 0, no layer gets drenched.

<image> The picture represents the first test case of the example.

Help Arkady determine which layers of the cake eventually get drenched when the process is over, and which don't.

Input

Each test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 20 000). Description of the test cases follows.

The first line of each test case contains a single integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the number of layers in the cake.

The second line of each test case contains n integers a_1, a_2, …, a_n (0 ≤ a_i ≤ n) — the amount of cream poured on the cake after adding each layer.

It is guaranteed that the sum of n over all test cases does not exceed 2 ⋅ 10^5.

Output

For each test case, print a single line with n integers. The i-th of the integers should be equal to 1 if the i-th layer from the bottom gets drenched, and 0 otherwise.

Example

Input


3
6
0 3 0 0 1 3
10
0 0 0 1 0 5 0 0 0 2
3
0 0 0


Output


1 1 0 1 1 1 
0 1 1 1 1 1 0 0 1 1 
0 0 0 

Solution (in CPP):

Solution:
#include <iostream>
#include<bits/stdc++.h>
#include <chrono> 
#include<time.h>
#include <sys/time.h>
#include <unistd.h>
#include <algorithm> 
#include <fstream> 
#define pi 3.14159265
#define ss second
#define ff first
#define pb push_back
#define endl '\n'
// #include <typeinfo>
// #include<String>
bool time_seed = 0;



using namespace std;
using namespace std::chrono;

// ifstream cin;
// cin.open("input.txt");

typedef long long int ll;
typedef vector<int> vi; 
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<double> vd; 
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef vector<bool> vb; 
typedef vector<vb> vvb;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vll; 
typedef vector<vll> vvll;
typedef pair<int,int> pii;
// typedef unordered_map ump;
// typedef unordered_map ump;
// #define unordered_map ump
// auto start = high_resolution_clock::now();
//     for(int i = 0;i<k;i++) s.lower_bound(i);
//     auto stop = high_resolution_clock::now(); 
//     auto duration = duration_cast<microseconds>(stop - start);
//     cout << "Time taken by function: "
//          << duration.count() << " microseconds" << endl; 
#define mod 1000000007
// #define mod 998244353
// #define unordered_map ump


struct ListNode {
    int val;
    ListNode *next;
    ListNode(int x) : val(x), next(NULL) {}
};  
struct TreeNode {
    int val;
    TreeNode *left;
    TreeNode *right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};


void show_vi(vector<int> t){
    // //cout<<"show_vi"<<endl;
    for(int i = 0;i<t.size();i++){
        cout<<t[i]<<",";
    }
    cout<<endl;
}

void show_vd(vector<double> t){
    // //cout<<"show_vi"<<endl;
    for(int i = 0;i<t.size();i++){
        cout<<t[i]<<",";
    }
    cout<<endl;
}
void show_vll(vector<ll> t){
    // //cout<<"show_vi"<<endl;
    for(int i = 0;i<t.size();i++){
        cout<<t[i]<<",";
    }
    cout<<endl;
}


void show_vt(vector<tuple<long long,long long>> t){
    // //cout<<"show_vi"<<endl;
    for(int i = 0;i<t.size();i++){
        cout<<get<0>(t[i])<<" "<<get<1>(t[i])<<"::";
    }
    cout<<endl;
}

void show_vb(vector<bool> t){
    // //cout<<"show_vi"<<endl;
    for(int i = 0;i<t.size();i++){
        cout<<t[i]<<" ";
    }
    cout<<endl;
}

void show_vvi(vector<vector<int>> ans){
    cout<<"---------------------------"<<endl;
    for(int i = 0;i<ans.size();i++){
        show_vi(ans[i]);
    }
    cout<<endl;
}

int randd(){
    // struct timeval end_time;
    timeval start_time;
    // cout<<"ok"<<endl;
    long milli_time, seconds, useconds;
    gettimeofday(&start_time, NULL);
    seconds = start_time.tv_sec;
    useconds = start_time.tv_usec;
    milli_time = ((seconds) * 1000 + useconds/1000.0);
    if(time_seed==0){
        time_seed = 1;
        srand(milli_time);
    }
    int k = rand();
    return k;
}

void show_vvvi(vvvi ans){
    for(int i = 0;i<ans.size();i++){
    cout<<"******************"<<endl;
        show_vvi(ans[i]);
    }
    cout<<endl;
}


void show_vvb(vector<vector<bool>> ans){
    cout<<"---------------------------"<<endl;
    for(int i = 0;i<ans.size();i++){
        show_vb(ans[i]);
    }
    cout<<endl;
}

void show_vs(vector<string> A){
    for(int i =0;i<A.size();i++){
        cout<<A[i]<<"::";
    }
    cout<<endl;
}

void show_vc(vector<char> A){
    for(int i =0;i<A.size();i++){
        cout<<A[i];
    }
    cout<<endl;
}

void show_vvc(vector<vector<char>> A){
    cout<<"---------------------------"<<endl;
    for(int i =0;i<A.size();i++){
        show_vc(A[i]);
    }
}

void show_vvs(vector<vector<string>> A){
    for(int i = 0;i<A.size();i++){
        show_vs(A[i]);
    }
}

void show_um(unordered_map<int,int> &map){
    unordered_map<int,int>::iterator it;
    it = map.begin();
    // int count = -6;
    while(it!=map.end()){
        cout<<it->ff<<" "<<it->second<<"::";
        // count ++;
        it++;
    }
    cout<<endl;
}

ll ncr(ll n, ll r) 
{ 
    // if(dp[n]!=-1) return dp[n];
    if (r > n - r) 
        r = n - r; 
    ll C[r + 1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1; 
    for (ll i = 1; i <= n; i++) { 
        for (int j = min(i, r); j > 0; j--) {
                C[j] = (C[j] + C[j - 1]) ; 
                C[j]%=mod;
            }
    } 
    return C[r]; 
} 

int fact(int n){
    return (n==0)?1:(ll)(n*fact(n-1))%mod;
}

int hcf(int a,int b){
    if(a%b==0) return b;
    return hcf(b,a%b);
}


vll prime_factors(ll n){
    vll ans;
    while (n % 2 == 0)  
    {  
        ans.push_back(2);
        n = n/2;  
    }  
   
    for (int i = 3; i <= sqrt(n); i = i + 2)  
    {   
        while (n % i == 0)  
        {  
            ans.push_back(i);  
            n = n/i;  
        }  
    }  
    if (n > 2)  
        ans.push_back(n);
    return ans;
}

ll pow_m(ll a,ll b){
    // cout<<a<<" "<<b<<endl;
    if(b==1) return a%mod;
    if(b==0) return 1%mod;
    ll k = (ll)pow_m(a,b/2);
    if(b%2){
        return (((k*k)%mod)*a)%mod;
    }
    else return (((k*k)%mod));

}

int modInverse(int a, int m) 
{ 
    return pow_m(a,m-2); 
} 

bool isPrime(int n) 
{ 
    // Corner cases 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
  
    // This is checked so that we can skip 
    // middle five numbers in below loop 
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
  
    for (int i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
  
    return true; 
} 


string int_to_hex(int a){
    if(a==0) return "0";
    string ans;
    while(a){
        int k = a%16;
        if(k<=9){
            ans+=('0'+k);
        }
        else{
            ans+=('A'+(k-10));
        }
        a/=16;
    }
    reverse(ans.begin(), ans.end());
    return ans;
}



int cnt_digit(ll a){
    int ans = 0;
    while(a!=0){
        ans++;
        a/=10;
    }
    return ans;
}

ll ncrr(ll a,ll b){
    // cout<<a<<" "<<b<<endl;
    ll ans = 1;
    for(int i = 0;i<b;i++){
        ans*=a;
        a--;
        ans%=mod;
    }

    for(int i = 1;i<=b;i++){
        ans*=(modInverse(i,mod));
        ans%=mod;
    }
    return ans;
}



void help(){
    int n;
    cin>>n;
    stack<int> st;
    vb ans(n);
    for(int i = 0;i<n;i++){
        st.push(i);
        int k;cin>>k;
        while(!st.empty()&&i-st.top()<k){
            ans[st.top()] = 1;
            st.pop();
        }
    }
    for(int i= 0;i<n;i++) cout<<ans[i]<<" ";
    cout<<endl;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t = 1;
    cin>>t;
    // cout<<"ok"<<endl;
    while(t-->0){
        help();
    }
    // cout<<(ll)(1e11)<<endl;
    return 0;
}