## Question :

$�$ of length $�$ consisting of non-negative integers.

She built a new array $�$ of length $�-1$, such that ${�}_{�}=max\left({�}_{�},{�}_{�+1}\right)$ ($1\le �\le �-1$).

For example, suppose Kristina had an array $�$ = [$3,0,4,0,5$] of length $5$. Then she did the following:

1. Calculated ${�}_{1}=max\left({�}_{1},{�}_{2}\right)=max\left(3,0\right)=3$;
2. Calculated ${�}_{2}=max\left({�}_{2},{�}_{3}\right)=max\left(0,4\right)=4$;
3. Calculated ${�}_{3}=max\left({�}_{3},{�}_{4}\right)=max\left(4,0\right)=4$;
4. Calculated ${�}_{4}=max\left({�}_{4},{�}_{5}\right)=max\left(0,5\right)=5$.
As a result, she got an array $�$ = [$3,4,4,5$] of length $4$.

You only know the array $�$. Find any matching array $�$ that Kristina may have originally had.

Input

The first line of input data contains a single integer $�$ ($1\le �\le {10}^{4}$) — the number of test cases.

The description of the test cases follows.

The first line of each test case contains one integer $�$ ($2\le �\le 2\cdot {10}^{5}$) — the number of elements in the array $�$ that Kristina originally had.

The second line of each test case contains exactly $�-1$ non-negative integer — elements of array $�$ ($0\le {�}_{�}\le {10}^{9}$).

It is guaranteed that the sum of $�$ over all test cases does not exceed $2\cdot {10}^{5}$, and that array $�$ was built correctly from some array $�$.

Output

For each test case on a separate line, print exactly $�$ non-negative integers — the elements of the array $�$ that Kristina originally had.

If there are several possible answers — output any of them.

Example
input
Copy
1153 4 4 542 2 150 0 0 060 3 4 4 321043 3 354 2 5 543 3 342 1 034 468 1 3 5 10
output
Copy
3 0 4 0 5
2 2 1 1
0 0 0 0 0
0 0 3 4 3 3
10 10
3 3 3 1
4 2 2 5 5
3 3 3 3
2 1 0 0
2 4 4
8 1 1 3 5 10

# Explanation :

b[1], min(b[1], b[2]), min(b[2], b[3]), ..., min(b[n-2], b[n-1]), b[n-1] is an answer.

# Solution :

#pragma GCC optimize("O3,unroll-loops")

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace chrono;
using namespace __gnu_pbds;

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e18
#define nline "\n"
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define ff first
#define ss second
#define PI 3.141592653589793238462
#define set_bits(x) __builtin_popcountll(x)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()

#define test     long long T;cin>>T;while(T--)
//#define ll             long long

#define fl(x, n) for (int x = 0; x < n; ++x)
#define cina(a, n) for(int i=0;i<n;i++){cin>>a[i];}

#ifdef Priyansh31dec
#define debug(x) cerr << #x<<" "; _print(x); cerr << endl;
#else
#define debug(x);
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;
typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_order_statistics_node_update > pbds; // find_by_order, order_of_key

void _print(ll t) {cerr << t;}
void _print(int t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(lld t) {cerr << t;}
void _print(double t) {cerr << t;}
void _print(ull t) {cerr << t;}

bool Campare(const auto a, const auto b){
if(a.first==b.first) return a.second<b.second;
return a.first>b.first;
}
bool prime[1000001];
#define int    long long int

int divisor(int n){
int cnt=0;
for(int i=1;i<=n;i++){
if(n%i==0) cnt++;
}
return cnt;
}

void solve(){
//1811 C
int n; cin>>n; vector<int> a(n-1), b(n);
for(int i=0;i<n-1;i++)
cin>>a[i];
b[0]= a[0]; b[n-1]= a[a.size()-1];
for(int i=0;i<n-2;i++)
b[i+1] = min(a[i],a[i+1]);
for(int i=0;i<n;i++)
cout<<b[i]<<" ";
cout<<endl;
}

signed main() {
freopen("Error.txt", "w", stderr);
#endif
fastio();
auto start1 = high_resolution_clock::now();

test
solve();

auto stop1 = high_resolution_clock::now();
auto duration = duration_cast<microseconds>(stop1 - start1);