#!/usr/bin/env python3 # %% import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import itertools MOD = 10 ** 9 + 9 # %% T, *M = map(int, read().split()) # %% U = 10 ** 5 dp = [0] * U dp[0] = 1 for n in range(1, 10): for i in range(U - n): dp[i + n] += dp[i] dp_cum = list(itertools.accumulate(dp)) dp_cum = [x % MOD for x in dp_cum] # %% for x in M: print(dp_cum[x // 111111])