#include #include #include #define repeat(i,n) for (int i = 0; (i) < (n); ++(i)) typedef long long ll; using namespace std; const int coins[] = { 1, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; const ll unit = 111111; const ll limit = 1e10; const ll len = (limit + unit - 1) / unit + 1; const ll mod = 1e9+9; int main() { // prepare vector dp(len); dp[0] = 1; for (int k : coins) { repeat (init,k) { ll acc = 0; for (ll i = init; i < len; i += k) { ll t = dp[i]; dp[i] = (dp[i] + acc) % mod; acc = (acc + t) % mod; } } } // input / output int t; cin >> t; repeat (i,t) { ll m; cin >> m; assert (m <= limit); cout << dp[m / unit] << endl; } return 0; }