#include <iostream>
using namespace std;
int main()
{
int a, b, c, d;
cin >> a >> b >> c >> d;
if (a%b == 0 || b%a == 0) cout << endl << a << ", " << b;
else if (a%c == 0 || c%a == 0) cout << endl << a << ", " << c;
else if (a%d == 0 || d%a == 0) cout << endl << a << ", " << d;
else if (b%c == 0 || c%b == 0) cout << endl << b << ", " << c;
else if (d%c == 0 || c%d == 0) cout << endl << c << ", " << d;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int a, b, c, d;
cin >> a >> b >> c >> d;
if (a%b == 0 || b%a == 0) cout << endl << a << ", " << b;
else if (a%c == 0 || c%a == 0) cout << endl << a << ", " << c;
else if (a%d == 0 || d%a == 0) cout << endl << a << ", " << d;
else if (b%c == 0 || c%b == 0) cout << endl << b << ", " << c;
else if (d%c == 0 || c%d == 0) cout << endl << c << ", " << d;
return 0;
}