#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <iostream>
#include <cstdlib>
#include <vector>
#include <set>
#include <deque>
#include <utility>
#include <cmath>
#include <string>
#include <cstring>
#include <iomanip>
#include <cctype>
#include <algorithm>
#include <numeric>
#define Yellow_Flash \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define pi 3.14159265358979323
#define el "\n"
#define ll long long
#define sp ' '
#define MAX INT_MAX
#define MIN INT_MIN
using namespace std;
using namespace __gnu_pbds;
ll Sum(ll num)
{
return num * (num + 1) / 2;
}
ll SumOdd(ll num)
{
long long res = (num + 1) / 2;
long long finalRes = res * res;
return finalRes;
}
ll SumEven(ll num)
{
long long res = (num * (num + 1));
return res;
}
bool Odd(ll num)
{
if (num & 1)
return true;
else
return false;
}
bool Even(ll num)
{
if (num & 1)
return false;
else
return true;
}
bool Palindrome_L(ll num)
{
ll cpy = num, palin = 0;
while (num > 0)
{
palin += num % 10;
num /= 10;
if (num)
palin *= 10;
}
if (cpy == palin)
return true;
else
return false;
}
bool Palindrome_S(string s)
{
string cpy = s;
reverse(s.begin(), s.end());
if (cpy == s)
return true;
else
return false;
}
string ToBinary(ll num)
{
string bin;
while (num > 0)
{
if (num & 1)
{
bin += '1';
num /= 2;
}
else
{
bin += '0';
num /= 2;
}
}
reverse(bin.begin(), bin.end());
return bin;
}
bool Prime(ll num)
{
if (num < 2)
return false;
else
{
for (ll i = 2; i * i <= num; ++i)
{
if (num % i == 0)
return false;
}
}
return true;
}
ll SumLtoR_divX(ll l, ll r, ll x)
{
ll sum = (Sum(r / x) * x) - (Sum((l - 1) / x) * x);
return sum;
}
ll Factorial(ll num)
{
ll fac = 1;
for (ll i = 2; i <= num; ++i)
{
fac *= i;
}
return fac;
}
ll PR(ll n, ll r)
{
ll mul = 1;
while (r--)
{
mul *= n;
}
return mul;
}
ll NPR(ll n, ll r)
{
return Factorial(n) / Factorial(n - r);
}
ll NCR(ll n, ll r)
{
return Factorial(n) / (Factorial(r) * Factorial(n - r));
}
ll CR(ll n, ll r)
{
return Factorial(r + n - 1) / (Factorial(r) * Factorial(n - 1));
}
ll GCD(ll x,ll y){
while (y!=0)
{
ll s=x;
x=y;
y=s%x;
}
return x;
}
bool LongDiv(string num, ll x)
{
ll rem = 0;
for (int i = 0; i < num.size(); ++i)
{
rem = (rem * 10 + (num[i] - '0')) % x;
}
if (rem == 0)
return true;
else
return false;
}
ll To_Decimal(string num)
{
ll e = 0, N = 0;
for (ll i = num.size() - 1; i >= 0; --i)
{
if (num[i] == '0')
e++;
else
{
N += pow(2, e);
e++;
}
}
return N;
}
int BinarySearch(vector<int> arr, int target)
{
int l = 0;
int r = arr.size() - 1;
while (l <= r)
{
int mid = l + (r - l) / 2;
if (arr[mid] == target)
{
return mid;
}
else if (arr[mid] < target)
{
l = mid + 1;
}
else
{
r = mid - 1;
}
}
return -1;
}
ll LCM(ll a, ll b)
{
ll res = (a / GCD(a, b)) * b;
return res;
}
ll Fast_power(ll num, ll pow)
{
ll res = 1;
while (pow > 0)
{
if (Odd(pow))
res *= num;
num *= num;
pow /= 2;
}
return res;
}
ll Modular_fast_power(ll num, ll pow, ll M)
{
ll res = 1;
while (pow > 0)
{
if (Odd(pow))
res *= (num % M);
num = ((num % M) * (num % M)) % M;
pow /= 2;
}
return res;
}
string AddLargeNums(string num1, string num2)
{
string res="";
ll n1=num1.size(), n2=num2.size();
ll n=max(n1,n2), carry=0;
for(int i=0; i<n; ++i)
{
ll d1, d2;
if(i<n1) d1=num1[n1-1-i]-'0';
else d1=0;
if(i<n2) d2=num2[n2-1-i]-'0';
else d2=0;
ll sum=d1+d2+carry;
carry=sum/10;
res.push_back(sum%10+'0');
}
if(carry){
res.push_back(carry+'0');
}
reverse(res.begin(),res.end());
return res;
}
string MultiplyLargeNums(string num1, int mul)
{
string res="";
ll carry=0, n=num1.size();
for(int i=0; i<n; ++i)
{
ll d=num1[n-i-1]-'0';
int p=d*mul+carry;
carry=p/10;
res.push_back(p%10+'0');
}
while(carry){
res.push_back(carry%10+'0');
carry/=10;
}
reverse(res.begin(),res.end());
return res;
}
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
bool comp (pair<string,ll> & a, pair<string,ll> & b){
if(a.second==b.second) return a.first<b.first;
else return a.second>b.second;
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
Yellow_Flash;
ll t;
cin >> t;
while(t--){
ll n;
cin >> n;
vector<ll> v(n), beg(n), end(n);
stack<ll> st;
map<ll,ll> ind;
for (int i=0; i<n; ++i) {
cin >> v[i];
ind[v[i]]=i;
}
for(int i=n-1; i>=0; --i){
while(!st.empty() && st.top()>v[i]) st.pop();
if(st.empty()) end[i]=ind[v[i]];
else end[i]=ind[st.top()];
st.push(v[i]);
}
for(int i=0; i<n; ++i){
while(!st.empty() && st.top()>v[i]) st.pop();
if(st.empty()) beg[i]=ind[v[i]];
else beg[i]=ind[st.top()];
st.push(v[i]);
}
ll mx=MIN;
for(int i=0; i<n; ++i){
if (beg[i]==-1 && end[i]==-1){
mx=max(n,mx);
}
else if (beg[i]==-1) {
mx=max(mx,end[i]);
}
else if (end[i]==-1) {
mx=max(mx,n-(beg[i]+1));
}
else {
mx=max(mx,end[i]-(beg[i]+1));
}
cout << beg[i] << sp << end[i] << sp << mx << el;
}
}
return 0;
}
/* Fight not to be the Winner ,but to be the last one to lose */
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNpbmNsdWRlIDxleHQvcGJfZHMvYXNzb2NfY29udGFpbmVyLmhwcD4KI2luY2x1ZGUgPGV4dC9wYl9kcy90cmVlX3BvbGljeS5ocHA+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGNzdGRsaWI+CiNpbmNsdWRlIDx2ZWN0b3I+CiNpbmNsdWRlIDxzZXQ+CiNpbmNsdWRlIDxkZXF1ZT4KI2luY2x1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TsKICAgIGVsc2UKICAgICAgICByZXR1cm4gdHJ1ZTsKfQpib29sIFBhbGluZHJvbWVfTChsbCBudW0pCnsKICAgIGxsIGNweSA9IG51bSwgcGFsaW4gPSAwOwogICAgd2hpbGUgKG51bSA+IDApCiAgICB7CiAgICAgICAgcGFsaW4gKz0gbnVtICUgMTA7CiAgICAgICAgbnVtIC89IDEwOwogICAgICAgIGlmIChudW0pCiAgICAgICAgICAgIHBhbGluICo9IDEwOwogICAgfQogICAgaWYgKGNweSA9PSBwYWxpbikKICAgICAgICByZXR1cm4gdHJ1ZTsKICAgIGVsc2UKICAgICAgICByZXR1cm4gZmFsc2U7Cn0KYm9vbCBQYWxpbmRyb21lX1Moc3RyaW5nIHMpCnsKICAgIHN0cmluZyBjcHkgPSBzOwogICAgcmV2ZXJzZShzLmJlZ2luKCksIHMuZW5kKCkpOwogICAgaWYgKGNweSA9PSBzKQogICAgICAgIHJldHVybiB0cnVlOwogICAgZWxzZQogICAgICAgIHJldHVybiBmYWxzZTsKfQpzdHJpbmcgVG9CaW5hcnkobGwgbnVtKQp7CiAgICBzdHJpbmcgYmluOwogICAgd2hpbGUgKG51bSA+IDApCiAgICB7CiAgICAgICAgaWYgKG51bSAmIDEpCiAgICAgICAgewogICAgICAgICAgICBiaW4gKz0gJzEnOwogICAgICAgICAgICBudW0gLz0gMjsKICAgICAgICB9CiAgICAgICAgZWxzZQogICAgICAgIHsKICAgICAgICAgICAgYmluICs9ICcwJzsKICAgICAgICAgICAgbnVtIC89IDI7CiAgICAgICAgfQogICAgfQogICAgcmV2ZXJzZShiaW4uYmVnaW4oKSwgYmluLmVuZCgpKTsKICAgIHJldHVybiBiaW47Cn0KYm9vbCBQcmltZShsbCBudW0pCnsKICAgIGlmIChudW0gPCAyKQogICAgICAgIHJldHVybiBmYWxzZTsKICAgIGVsc2UKICAgIHsKICAgICAgICBmb3IgKGxsIGkgPSAyOyBpICogaSA8PSBudW07ICsraSkKICAgICAgICB7CiAgICAgICAgICAgIGl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plKCk7ICsraSkKICAgIHsKICAgICAgICByZW0gPSAocmVtICogMTAgKyAobnVtW2ldIC0gJzAnKSkgJSB4OwogICAgfQogICAgaWYgKHJlbSA9PSAwKQogICAgICAgIHJldHVybiB0cnVlOwogICAgZWxzZQogICAgICAgIHJldHVybiBmYWxzZTsKfQpsbCBUb19EZWNpbWFsKHN0cmluZyBudW0pCnsKICAgIGxsIGUgPSAwLCBOID0gMDsKICAgIGZvciAobGwgaSA9IG51bS5zaXplKCkgLSAxOyBpID49IDA7IC0taSkKICAgIHsKICAgICAgICBpZiAobnVtW2ldID09ICcwJykKICAgICAgICAgICAgZSsrOwogICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAgICAgIE4gKz0gcG93KDIsIGUpOwogICAgICAgICAgICBlKys7CiAgICAgICAgfQogICAgfQogICAgcmV0dXJuIE47Cn0KaW50IEJpbmFyeVNlYXJjaCh2ZWN0b3I8aW50PiBhcnIsIGludCB0YXJnZXQpCnsKICAgIGludCBsID0gMDsKICAgIGludCByID0gYXJyLnNpemUoKSAtIDE7CgogICAgd2hpbGUgKGwgPD0gcikKICAgIHsKICAgICAgICBpbnQgbWlkID0gbCArIChyIC0gbCkgLyAyOwoKICAgICAgICBpZiAoYXJyW21pZF0gPT0gdGFyZ2V0KQogICAgICAgIHsKICAgICAgICAgICAgcmV0dXJuIG1pZDsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoYXJyW21pZF0gPCB0YXJnZXQpCiAgICAgICAgewogICAgICAgICAgICBsID0gbWlkICsgMTsKICAgICAgICB9CiAgICAgICAgZWxzZQogICAgICAgIHsKICAgICAgICAgICAgciA9IG1pZCAtIDE7CiAgICAgICAgfQogICAgfQogICAgcmV0dXJuIC0xOwp9CmxsIExDTShsbCBhLCBsbCBiKQp7CiAgICBsbCByZXMgPSAoYSAvIEdDRChhLCBiKSkgKiBiOwogICAgcmV0dXJuIHJlczsKfQpsbCBGYXN0X3Bvd2VyKGxsIG51bSwgbGwgcG93KQp7CiAgICBsbCByZXMgPSAxOwogICAgd2hpbGUgKHBvdyA+IDApCiAgICB7CiAgICAgICAgaWYgKE9kZChwb3cpKQogICAgICAgICAgICByZXMgKj0gbnVtOwogICAgICAgIG51bSAqPSBudW07CiAgICAgICAgcG93IC89IDI7CiAgICB9CiAgICByZXR1cm4gcmVzOwp9CmxsIE1vZHVsYXJfZmFzdF9wb3dlcihsbCBudW0sIGxsIHBvdywgbGwgTSkKewogICAgbGwgcmVzID0gMTsKICAgIHdoaWxlIChwb3cgPiAwKQogICAgewogICAgICAgIGlmIChPZGQocG93KSkKICAgICAgICAgICAgcmVzICo9IChudW0gJSBNKTsKICAgICAgICBudW0gPSAoKG51bSAlIE0pICogKG51bSAlIE0pKSAlIE07CiAgICAgICAgcG93IC89IDI7CiAgICB9CiAgICByZXR1cm4gcmVzOwp9CnN0cmluZyBBZGRMYXJnZU51bXMoc3RyaW5nIG51bTEsIHN0cmluZyBudW0yKQp7CiAgICBzdHJpbmcgcmVzPSIiOwogICAgbGwgbjE9bnVtMS5zaXplKCksIG4yPW51bTIuc2l6ZSgpOwogICAgbGwgbj1tYXgobjEsbjIpLCBjYXJyeT0wOwogICAgZm9yKGludCBpPTA7IGk8bjsgKytpKQogICAgewogICAgICAgIGxsIGQxLCBkMjsKICAgICAgICBpZihpPG4xKSBkMT1udW0xW24xLTEtaV0tJzAnOwogICAgICAgIGVsc2UgZDE9MDsKICAgICAgICBpZihpPG4yKSBkMj1udW0yW24yLTEtaV0tJzAnOwogICAgICAgIGVsc2UgZDI9MDsKICAgICAgICBsbCBzdW09ZDErZDIrY2Fycnk7CiAgICAgICAgY2Fycnk9c3VtLzEwOwogICAgICAgIHJlcy5wdXNoX2JhY2soc3VtJTEwKycwJyk7CiAgICB9CiAgICBpZihjYXJyeSl7CiAgICAgICAgcmVzLnB1c2hfYmFjayhjYXJyeSsnMCcpOwogICAgfQogICAgcmV2ZXJzZShyZXMuYmVnaW4oKSxyZXMuZW5kKCkpOwogICAgcmV0dXJ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aW4gPj4gbjsKICAgICAgICB2ZWN0b3I8bGw+IHYobiksIGJlZyhuKSwgZW5kKG4pOwogICAgICAgIHN0YWNrPGxsPiBzdDsKICAgICAgICBtYXA8bGwsbGw+IGluZDsgCiAgICAgICAgZm9yIChpbnQgaT0wOyBpPG47ICsraSkgewogICAgICAgICAgICBjaW4gPj4gdltpXTsKICAgICAgICAgICAgaW5kW3ZbaV1dPWk7CiAgICAgICAgfQogICAgICAgIGZvcihpbnQgaT1uLTE7IGk+PTA7IC0taSl7CiAgICAgICAgICAgIHdoaWxlKCFzdC5lbXB0eSgpICYmIHN0LnRvcCgpPnZbaV0pIHN0LnBvcCgpOwogICAgICAgICAgICBpZihzdC5lbXB0eSgpKSBlbmRbaV09aW5kW3ZbaV1dOwogICAgICAgICAgICBlbHNlIGVuZFtpXT1pbmRbc3QudG9wKCldOwogICAgICAgICAgICBzdC5wdXNoKHZbaV0pOwogICAgICAgIH0KICAgICAgICBmb3IoaW50IGk9MDsgaTxuOyArK2kpewogICAgICAgICAgICB3aGlsZSghc3QuZW1wdHkoKSAmJiBzdC50b3AoKT52W2ldKSBzdC5wb3AoKTsKICAgICAgICAgICAgaWYoc3QuZW1wdHkoKSkgYmVnW2ldPWluZFt2W2ldXTsKICAgICAgICAgICAgZWxzZSBiZWdbaV09aW5kW3N0LnRvcCgpXTsKICAgICAgICAgICAgc3QucHVzaCh2W2ldKTsKICAgICAgICB9CiAgICAgICAgbGwgbXg9TUlOOwogICAgICAgIGZvcihpbnQgaT0wOyBpPG47ICsraSl7CiAgICAgICAgICAgIGlmIChiZWdbaV09PS0xICYmIGVuZFtpXT09LTEpewogICAgICAgICAgICAgICAgbXg9bWF4KG4sbXgpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYgKGJlZ1tpXT09LTEpIHsKICAgICAgICAgICAgICAgIG14PW1heChteCxlbmRbaV0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYgKGVuZFtpXT09LTEpIHsKICAgICAgICAgICAgICAgIG14PW1heChteCxuLShiZWdbaV0rMSkpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgbXg9bWF4KG14LGVuZFtpXS0oYmVnW2ldKzEpKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBjb3V0IDw8IGJlZ1tpXSA8PCBzcCA8PCBlbmRbaV0gPDwgc3AgPDwgbXggPDwgZWw7CiAgICAgICAgfQogICAgfQogICAgcmV0dXJuIDA7Cn0KICAgICAgICAgICAgICAgIC8qIEZpZ2h0IG5vdCB0byBiZSB0aGUgV2lubmVyICxidXQgdG8gYmUgdGhlIGxhc3Qgb25lIHRvIGxvc2UgKi8K