Monocarp is playing yet another computer game. And yet again, his character is killing some monsters. There are n monsters, numbered from 11 to n, and the i-th of them has aihealth points initially.
Monocarp's character has an ability that deals k damage to the monster with the highest current health. If there are several of them, the one with the smaller index is chosen. If a monster's health becomes less than or equal to 00 after Monocarp uses his ability, then it dies.
Monocarp uses his ability until all monsters die. Your task is to determine the order in which monsters will die.
Input
The first line contains a single integer t(1≤t≤10的四次方) — the number of test cases.
The first line of each test case contains two integers n and k (1≤n≤3⋅10的五次方; 1≤k≤10的九次方) — the number of monsters and the damage which Monocarp's ability deals.
The second line contains n integers a1,a2,…,an (1≤ai≤10的九次方) — the initial health points of monsters.
The sum of n over all test cases doesn't exceed 3⋅1053⋅105.
Output
For each test case, print n integers — the indices of monsters in the order they die.
Example
input
3
3 2
1 2 3
2 3
1 1
4 3
2 8 3 5
output
2 1 3 1 2 3 1 2 4
Note
In the first example, the health points change as follows: [1,2,3–]→[1,2–,1]→[1–,0,1]→[−1,0,1–]→[−1,0,−1][1,2,3_]→[1,2_,1]→[1_,0,1]→[−1,0,1_]→[−1,0,−1]. The monster that is going to take damage the next time Monocarp uses his ability is underlined.
In the second example, the health points change as follows: [1–,1]→[−2,1–]→[−2,−2][1_,1]→[−2,1_]→[−2,−2].
In the third example, the health points change as follows: [2,8–,3,5]→[2,5–,3,5]→[2,2,3,5–]→[2,2,3–,2]→[2–,2,0,2]→[−1,2–,0,2]→[−1,−1,0,2–]→[−1,−1,0,−1][2,8_,3,5]→[2,5_,3,5]→[2,2,3,5_]→[2,2,3_,2]→[2_,2,0,2]→[−1,2_,0,2]→[−1,−1,0,2_]→[−1,−1,0,−1].
#include<bits/stdc++.h>
using namespace std;
struct M
{
int d,id;
}a[3000005];
bool cmp(M a,M b)
{
if(a.d!=b.d ) return a.d>b.d;
return a.id<b.id;
}
int main()
{
int t;
cin>>t;
while(t--)
{
int n,k;
cin>>n>>k;
for(int i=1;i<=n;i++)
{
cin>>a[i].d;
a[i].d%=k;
if(a[i].d==0) a[i].d=k;
a[i].id=i;
}
sort(a+1,a+n+1,cmp);
for(int i=1;i<=n;i++)
cout<<a[i].id<<" ";
cout<<endl;
}
return 0;
}