// // Created by cteam19 on 10/21/23. // #include int main() { int C, M; std::cin >> C >> M; while(M--) { int x; std::cin >> x; int y = C / x; if (x * y == C) { if (x < y) { std::cout << x << " " << y << std::endl; return 0; } else { std::cout << y << " " << x << std::endl; return 0; }; } } return 0; }