#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int a, b, mod;
  int mark[400000];
  cin >> a >> b >> mod;
  int k = 1000000000 % mod;
  if (b >= mod - 1 || k == 0) {
    printf("2\n");
    return 0;
  }
  for (int i = 0; i < mod / 32 + 1; i++) mark[i] = 0;
  int res = 1, rem = k;
  bool found = false;
  while (!found) {
    int i = rem / 32, j = rem % 32;
    if (rem > 0 && mod - rem > b) {
      found = true;
      break;
    } else if ((mark[i]) & (1 << j)) {
      break;
    } else {
      mark[i] |= (1 << j);
      rem = (rem + k) % mod;
      res++;
      if (res > a) break;
    }
  }
  if (!found || res > a)
    printf("2\n");
  else
    printf("1 %09d\n", res);
  return 0;
}
