#include <vector>
#include <iostream>
template <typename T>
void print_array(std::vector<T> const &x) {
for (auto y : x) {
std::cout << y << " ";
}
std::cout << std::endl;
}
int main(void) {
int in = 0;
std::cin >> in;
std::vector<int> x;
int sum = 0;
// Always divisible by 3 if the sum of all digits is
// divisible by 3
while (in != 0) {
int d = in % 10;
x.push_back(d);
in /= 10;
sum += d;
}
// Now we have all the digits and the sum, just figure
// out what needs to be added by taking the sum modulo
// 3 and adding that
int m3 = sum % 3;
x.push_back(3 - m3);
// Now we need to make a number, pop a number off the top
// and multiply by 10 each time
int res = 0;
for (int i = (x.size() - 1); i >= 0; --i) {
res += x[i];
res *= 10;
}
res /= 10;
// Ok now that we have the number, should be divisible by 3
int factor = res / 3;
std::cout << res << std::endl;
std::cout << factor << " " << 3 << std::endl;
return 0;
}