Given an array of numbers form **0 to 9** of size **N**. Your task is to rearrange elements of the array such that after combining all the elements of the array number formed is maximum.

**Input:**

The first line of input contains an integer **T** denoting the number of test cases. Then T test cases follow. The first line of each test case contains an integer N denoting the number of elements in the array. Then in the next line are N space seperated integers denoting the elements of the array.

**Output:**

For each test case print a single line a number denoting the largest number that can be achieved by rearranging the elements of the array.

**Constraints:**

1 <= T <= 10^{3}

1 <= N <= 10^{7}

0 <= A_{i }<= 9

**Example:**

**Input:**

2

5

9 0 1 3 0

3

1 2 3

**Output:**

93100

321

**Explanation:
Testcase1:** Largest number is 93100 which can be formed from array digits.

BadiMehnatLagtiHaiEasySawalMe | 480 |

RohitBattu | 168 |

Jihye Sofia Seo | 162 |

aman19 | 160 |

piyushmittal25 | 156 |

AdityaSharma16 | 490 |

BadiMehnatLagtiHaiEasySawalMe | 480 |

saumitra13325 | 446 |

blackshadows | 388 |

ashujack | 377 |

blackshadows | 5146 |

akhayrutdinov | 5099 |

Ibrahim Nash | 5071 |

Quandray | 4354 |

sanjay05 | 3668 |

Login to report an issue on this page.