#include <bits/stdc++.h>
using namespace std;
bool used[3][10000001];
int main() {
  int A, B, M;
  while (~scanf("%d%d%d", &A, &B, &M)) {
    memset(used, false, sizeof(used));
    int ex = 1000000000 % M;
    for (int i = 0; i <= A; i++) {
      int c = (int)(((long long)(i % M) * (long long)(ex)) % M);
      if (used[0][c]) break;
      used[0][c] = true;
    }
    for (int i = 0; i <= B; i++) {
      int c = (-i % M + M) % M;
      if (used[1][c]) break;
      used[1][c] = true;
    }
    int res = -1;
    for (int i = 0; i <= A; i++) {
      int c = (int)(((long long)(i % M) * (long long)(ex)) % M);
      if (used[2][c]) break;
      used[2][c] = true;
      if (used[0][c] && !used[1][c]) {
        res = i;
        break;
      }
    }
    if (res > -1)
      printf("1 %09d\n", res);
    else
      printf("2\n");
  }
  return 0;
}
