exec("print([0,1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99,8605,8705,8706,9706,9806,9807][K]if(K:=int(input()))<=24 else -1);"*int(input()))