/* Solution Author: Mikhail Ivanov Date: 29.04.2018 */ #include using namespace std; void outans(const int& divisors, const int& number) { cout << divisors << '\n' << number << '\n'; } int main() { int n; cin >> n; int v[10]; for (int i = 0; i < 10; ++i) v[i] = 0; for (int i = 0; i < n; ++i) { int k; cin >> k; ++v[k]; } if (v[1] >= 1) outans(1, 1); else if (v[2] >= 1) outans(2, 2); else if (v[3] >= 1) outans(2, 3); else if (v[5] >= 1) outans(2, 5); else if (v[7] >= 1) outans(2, 7); else if (v[9] >= 1) { if (v[8] >= 1) outans(2, 89); else if (v[4] >= 1) { if (v[0] >= 1) outans(2, 409); else if (v[4] >= 2) outans(2, 449); else if (v[9] >= 2) outans(2, 499); else if (v[6] >= 2) outans(2, 6469); else outans(3, 9); } else outans(3, 9); } else if (v[4] >= 1) outans(3, 4); else if (v[6] >= 1) outans(4, 6); else if (v[8] >= 1) outans(4, 8); return 0; }