#include <bits/stdc++.h>
using namespace std;
bool B[10000010];
int main() {
  int a, b, mod;
  cin >> a >> b >> mod;
  if (b >= mod - 1)
    cout << 2;
  else {
    for (int s1 = 0; true; s1++) {
      int k = int((s1 * 1000000000LL) % mod);
      if (B[k] || s1 == a + 1) {
        cout << 2;
        break;
      }
      B[k] = true;
      if (k && k + b < mod) {
        printf("1 %.9d", s1);
        break;
      }
    }
  }
  return 0;
}
