#include<iostream>
using namespace std;
void func(int i,int arr[],int ans[]){
	if(arr[i]>=i+1){
		return ;
	}
	if(arr[i]==0){
	ans[i]=0;
     func(i-1,arr,ans);
     return;
}
	else{
		int currpos=i;int destionation=i-(arr[i]-1);
		while(currpos>=0){
			if(currpos!=destionation){
				if(arr[currpos]>=currpos+1)
				return;
				if(arr[currpos]!=0){
				destionation=destionation>currpos-(arr[currpos]-1)?currpos-(arr[currpos]-1):destionation;}
			}
			else{
				if(arr[currpos]>=currpos+1)
				return;
				if(arr[currpos]==0 or arr[currpos]==1){
				func(currpos-1,arr,ans);return;
				}
				destionation=destionation>currpos-(arr[currpos]-1)?currpos-arr[currpos]+1:destionation;
			}
			currpos-=1;
		}
		return ;
	}
}
int main(){
	int t;cin>>t;
	while(t--){
		int n;cin>>n;int arr[n];int ans[n];for(int i=0;i<n;i++){
			cin>>arr[i];ans[i]=1;
		}
		func(n-1,arr,ans);
		for(int i=0;i<n;i++){
			cout<<ans[i]<<" ";
		}
	}
}