#include using namespace std; typedef long long ll; const ll MOD = 1e9 + 9; const int MAX = 100000; int coin[] = {1, 1, 2, 3, 4, 5, 6, 7, 8, 9}; ll dp[MAX]; int main(){ dp[0] = 1; for(int i=0;i<10;i++){ for(int sum=0;sum+coin[i]> T; while(T--){ ll M; cin >> M; cout << dp[M / 111111] << endl; } return 0; }