import java.util.Scanner; public class Main{ private long MOD = 1000000007; private long calc(char[] n, int p){ long dp[][][]; dp = new long[2][p][16]; dp[0][0][0] = 1; int u = 0; int v = 1; int sz = n.length; for(int i=0; ik) continue; int a_ = a | (d=MOD) dp[v][j_][s_] -= MOD; } }}} } u ^= 1; v ^= 1; } long ret = 0; for(int j=1; j= MOD) ret-=MOD; }}}} return ret; } private void solver(){ Scanner s = new Scanner(System.in); char[] a = s.next().toCharArray(); char[] b = s.next().toCharArray(); int p = Integer.parseInt(s.next()); long ans = calc(b, p); ans = (ans - calc(a,p) + MOD) % MOD; int x = 0; int y = 0; int z = 0; for(int i=0; i