#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair i_i; typedef pair ll_i; typedef pair d_i; typedef pair ll_ll; typedef pair d_d; struct edge { int u, v; ll w; }; ll MOD = 1000000007; ll _MOD = 1000000009; int dx[4] = {-1, 0, 1, 0}; int dy[4] = {0, -1, 0, 1}; int main() { int T; cin >> T; vector dp(100001, 1); for (int i = 1; i <= 9; i++) for (int j = 0; j <= 100000; j++) if (j - i >= 0) dp[j] = (dp[j] + dp[j - i]) % _MOD; while (T--) { ll M; cin >> M; cout << dp[M / 111111] << endl; } }