import java.util.*; import java.io.*; import static java.util.Arrays.*; import static java.lang.Math.*; public class No0189 { static final Scanner in = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static final int MOD = 1_000_000_009; static void solve() { String m = in.next(); String d = in.next(); dp(m,0); dp(d,1); int ml = m.length(); int dl = d.length(); long res = 0; for (int i=1; i<2000; i++) { long x = (dp[0][ml][i][0] + dp[0][ml][i][1]); long y = (dp[1][dl][i][0] + dp[1][dl][i][1]); res = (res + x*y)%MOD; } out.println(res); } static long[][][][] dp = new long[2][210][2000][2]; static void dp(String s, int f) { int n = s.length(); dp[f][0][0][1] = 1; for (int i=0; i