Given a number n, find the smallest number that has same set of digits as n and is greater than n. If x is the greatest possible number with its set of digits, then print “not possible”.

**Input:**

The first line of input contains an integer T denoting the number of test cases.

The first line of each test case is n,n is the number.

**Output:**

Print the greater number than n with same set of digits and if not possible then print "not possible" without double quote.

**Constraints:**

1 ≤ T ≤ 100

1 ≤ n ≤ 100000

**Example:**

Input

2

143

431

Output

314

not possible

Ibrahim Nash | 107 |

aristotle | 79 |

Stark_Maverick | 77 |

shankyy | 73 |

Lam Ngoc Pham | 71 |

Lam Ngoc Pham | 476 |

All Is Well | 399 |

Prateek Gole | 385 |

Divvya Sinha | 374 |

Ibrahim Nash | 347 |

akhayrutdinov | 3868 |

sanjay05 | 3366 |

Michael Riegger | 2033 |

Jasleen Kaur 2 | 2012 |

Quandray | 1982 |