#include <iostream>
using namespace std;

int main() {

    int arr[6] = { 0 };
    int len = sizeof(arr) / sizeof(int);
    
    for (int i = 0; i < len; i++) {
        cin >> arr[i];
    }

    // write your code here......
    int max=arr[0];
    int min=arr[0];
    for (int i=1;i<len;i++)
    {
        if(arr[i]<min)
        {
            min=arr[i];
        }
        if(arr[i]>max)
        {
            max=arr[i];
        }


    }
    cout<<min<<" "<<max<<endl;
    return 0;
}