#include <bits/stdc++.h>
using namespace std;
#define all(v) (v.begin()), (v.end())
#define sor(x) sort(all(x))
#define pb(x) push_back(x)
#define fl(v, d) (memset(v, d, sizeof(v)))
#define len(s) ((int)s.size())
typedef long long ll;
typedef vector<int> vii;
#define MOD ll(1e9 + 7)
#define N (const ll)1e5 + 1
inline void solve()
{
int n;
cin >> n;
pair<int, int> mx = {0, 0};
for (int i = 0; i < n; i++)
{
int x;
cin >> x;
if (x > mx.first)
{
mx.first = x;
mx.second = 0;
}
if (x == mx.first)
{
mx.second++;
}
}
for (int i = 0; i < mx.second; i++)
{
cout << mx.first << ' ';
}
cout << '\n';
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int t = 1;
cin >> t;
while (t--)
{
solve();
}
}
Copy