import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;
class Solution {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
int T = Integer.parseInt(br.readLine());
for (int t = 1; t <= T; t++) {
int n = Integer.parseInt(br.readLine());
StringTokenizer st = new StringTokenizer(br.readLine());
List<Integer> list = new ArrayList<>();
for (int i = 0; i < n * 2; i++) {
list.add(Integer.parseInt(st.nextToken()));
}
Collections.sort(list, Collections.reverseOrder());
List<Integer> result = new ArrayList<>();
while (!list.isEmpty()) {
int num = list.remove(0);
int calculateNum = (int) (num * 0.75);
result.add(calculateNum);
int findCalculateNumIdx = list.indexOf(calculateNum);
list.remove(findCalculateNumIdx);
}
Collections.sort(result);
sb.append("#" + t + " ");
result.forEach(num -> sb.append(num + " "));
sb.append("\n");
}
System.out.println(sb);
}
}