#include #include #include using namespace atcoder; using mint = modint; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000 int main(){ mint::set_mod(1000000009); vector dp(10,vector(100000,0)); dp[0][0] = 1; rep(i,10){ int c = max(i,1); rep(j,100000){ if(i!=9){ dp[i+1][j] += dp[i][j]; } if(j+c<100000){ dp[i][j+c] += dp[i][j]; } } } int _t; cin>>_t; rep(_,_t){ long long m; cin>>m; m /= 111111; cout<