#include using namespace std; typedef long long ll; typedef unsigned long long ull; #define F first #define S second #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() const int INF = 1e9; const ll LLINF = 4e18; const double EPS = 1e-9; #define int long long ll calc(int a, int b) { return a * b; } void solve() { ll c; cin >> c; int m; cin >> m; vector a(m); for (int i = 0; i < m; i++) cin >> a[i]; sort(all(a)); for (int i = 0; i < m; i++) { int l = 0, r = m - 1; while (l <= r) { int mid = (l+r) / 2; ll res = calc(a[i], a[mid]); if (res == c && mid != i) { cout << min(a[i], a[mid]) << " " << max(a[i], a[mid]) << endl; return; } else if (res > c) { r = mid - 1; } else { l = mid + 1; } } } } signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); solve(); }