#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long dp[100010] = {}; long long mod = 1000000009; int main() { dp[0] = 1; for (int i = 1; i < 10; i++) { for (int j = 0; j < 100000; j++) { dp[i + j] += dp[j]; dp[i + j] %= mod; } } for (int i = 1; i < 100000; i++) { dp[i] += dp[i - 1]; dp[i] %= mod; } int q; cin >> q; for (int i = 0; i < q; i++) { long long m; cin >> m; cout << dp[m / 111111] << endl; } }