#include #include int main() { int y; std::cin >> y; for (int b = 2; b < 17; ++b) { if (y % (b * b) == 0) { std::stringstream ss; while (y > 0) { int d = y % b; char c = (d < 10) ? ('0' + d) : ('A' + d - 10); ss << c; y /= b; } std::string revnumber(ss.str()); std::string number(revnumber.rbegin(), revnumber.rend()); std::cout << b << " " << number << std::endl; return 0; } } std::cout << "impossible" << std::endl; return 0; }