Problem: You are given a positive number x. Find the smallest positive integer number that has the sum of digits equal to x and all digits are distinct (unique).

Input

The first line contains a single positive integer t (1 ≤ t ≤ 50) — the number of test cases in the test. Then t test cases follow.

Each test case consists of a single integer number x (1 ≤ x ≤ 50).

Output

Output t answers to the test cases:

  * if a positive integer number with the sum of digits equal to x and all digits are different exists, print the smallest such number; 
  * otherwise print -1. 

Example

Input


4
1
5
15
50


Output


1
5
69
-1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
#define ll                long long int
#define fi                first
#define se                second
#define pb                push_back
#define mpp               make_pair()
#define rep(i,a,b)        for(ll i = a;i < b;i++)
#define rep(i,j,n)        for(ll i = j;i < n;i++)
#define vec               vector<ll>
#define read(v)           vec v(n,0); rep(i,0,n) {cin>>v[i];}
#define pairs             pair<int,int>
#define write(a,n)        rep(i,0,n) {cout<<a[i]<<" ";}
#define all(v)            v.begin(),v.end()
#define srt(v)            sort(v.rbegin(),v.rend())
#define scn(a)            cin>>a
#define nl                endl
#define MAX               100003


void solve()
{
    int n;
    cin>>n;
    int sum=0;
    int f;
    int mid;
    if(n<=9)
    {
        cout<<n<<nl;
        return;
    }
    if(n>45)
    {
        cout<<-1<<nl;
        return;
    }
    for(int i=1;i<=8;i++)
    {
        if(i+9==n)
        {
            cout<<i<<9<<nl;
            return;
        }
    }
    string ans="";
    for(int i=9;i>=1;i--)
    {
        if(n>=i)
        {
            ans+=i + '0';
            n=n-i;
        }
    }
    if(n==0)
    {
        sort(all(ans));
        cout<<ans<<endl;
        return;
    }
    cout<<-1<<nl;
}
int main()
{
    ll t=1;
    cin>>t;
    while(t-->0)
    {
      solve();
      //solve2();
    }
}