#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);

    int t;
    cin>>t;
    while (t--)
    {
        int n;
        cin>>n;
        if (n<=10)
        {
            if (n == 10){cout<<0;}
            else {cout<<n;}
        }
        else (cout<<0;)
    }
}