#include using namespace std; int main(){ unsigned long long product; cin >> product; int idk; cin >> idk; unsigned long long num; while(true){ cin >> num; if(product % num == 0){ unsigned long long delitel = product / num; cout << min(num, delitel) << " " << max(num, delitel) << endl; break; } } return 0; }