#include <bits/stdc++.h>
using namespace std;
int e[10000009];
void pri(int i, int x) {
  if (i > 9) return;
  pri(i + 1, x / 10);
  cout << x % 10;
}
int main() {
  int a, b, mod;
  cin >> a >> b >> mod;
  if (b >= mod - 1) {
    cout << 2 << endl;
    return 0;
  }
  if (a > mod - 1) a = mod - 1;
  int pow10 = 1;
  for (int i = 0; i < (9); i++) pow10 *= 10;
  int T = (pow10) % mod;
  if (!T) {
    cout << 2 << endl;
    return 0;
  }
  int x = mod - b;
  for (int u = (1); u <= (a); u++) {
    long long gt = u;
    gt *= T;
    gt %= mod;
    if (gt >= x || gt == 0) e[u] = 1;
  }
  int ok = 0;
  for (int u = (1); u <= (a); u++)
    if (!e[u]) {
      ok = u;
      break;
    }
  if (ok) {
    cout << 1 << " ";
    pri(1, ok);
    cout << endl;
  } else
    cout << 2 << endl;
  return 0;
}
