#include #include #include #include //#include #include #include #include #include #include //#include #include #include #include //#include #include #include //#include #include #include #include #include const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, 1, 0, -1}; using namespace std; typedef long long ll; typedef vector vi; typedef vector vll; typedef pair pii; const ll ZORO = 111111; const ll MAX = 10000000000ll/ZORO + 10; const ll MOD = 1e9+9; ll dp[11][MAX]; int main() { cin.tie(0); ios::sync_with_stdio(false); int T; cin >> T; for (int i = 0; i < MAX; i++) dp[0][i] = 1; for (int i = 1; i <= 9; i++) { for (int j = 0; j < MAX; j++) { dp[i][j] = dp[i-1][j]; if (j-i >= 0) (dp[i][j] += dp[i][j-i]) %= MOD;; } } while (T--) { ll M; cin >> M; ll tar = M/ZORO; cout << dp[9][tar] << endl; } return 0; }