#include <bits/stdc++.h>
const int maxm = 10000000;
bool inD[maxm];
int main() {
  int a, b, m;
  std::cin >> a >> b >> m;
  bool p1CanWin = false;
  int ans;
  if (a > 0 and b < m) {
    int x0 = 1000000000 % m;
    int d = 0;
    for (int i = 0; i < m; i++) inD[i] = false;
    int min_d, min_i;
    min_d = m;
    for (int i = 1; i <= a; i++) {
      d = (d + x0) % m;
      if (inD[d]) break;
      inD[d] = true;
      if (d > 0 and d < m - b) {
        p1CanWin = true;
        ans = i;
        break;
      }
    }
  }
  if (p1CanWin) {
    printf("1 %09d\n", ans);
  } else {
    printf("2\n");
  }
}
