#include <iostream>
#include<algorithm>
#include<vector>
int a[100000];
using namespace std;
int main()
{
int temp,pos=0;
while(cin >> temp)
{
a[pos++] = temp;
if(cin.peek()=='\n')
break;
}
cout << *max_element(a,a+pos)<< " " << *min_element(a,a+pos);
}