#include <iostream>

using namespace std;

int main()
{
    int T,s,n,p;
    cin >> T;
    s=0;
    p=0;
    for (int i=1; i<=T; i++)
    {
        cin >> n;
        if(n<10)
        {
            for (int j=1; j<=n; j++)
            {
                s=s+1;
            }
            cout << s << endl;
        }
        else
        {
            for (int y=10; y<=n; y++)
            {
                p=p+1;
            }
            cout << p+9 << endl;
        }


    }

    return 0;
}