#include <bits/stdc++.h>   using namespace std;   long long arr[1002][2][102];   long long p10[1002];   long long n, m, k;   long long ans = 0;   void pree() {     p10[0] = 1;     for (long long i = 1; i <= n; ++i) {       p10[i] = p10[i - 1] * 10LL;       p10[i] %= k;     }   }   void solve() {     pree();     arr[0][0][0] = 1;     long long i, j;     long long p;     long long ti;     long long ti2;     for (i = 1; i <= n; ++i) {       for (j = 1; j < k; ++j) {         arr[i][0][j] = (arr[i - 1][1][j] + arr[i - 1][0][j]) % m;       }       arr[i][0][0] = arr[i - 1][0][0];       for (j = 1; j <= 9; ++j) {         ti = j * p10[i - 1];         ti %= k;         for (p = 1; p < k; ++p) {           ti2 = (p + ti) % k;           arr[i][1][ti2] += arr[i - 1][1][p] + arr[i - 1][0][p];           arr[i][1][ti2] %= m;         }         ti2 = ti;         arr[i][1][ti2] += arr[i - 1][0][0];         arr[i][1][ti2] %= m;       }     }     ans = arr[n][1][0];     ti = 9;     ti %= m;     for (i = n - 1; i > 0; --i) {       ans += ti * arr[i][1][0];       ans %= m;       ti *= 10;       ti %= m;     }   }   void MAIN() {     scanf( %I64d %I64d %I64d , &n, &k, &m);     solve();     printf( %I64d n , ans);   }   int main() {     MAIN();     return 0;   }   