#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <numeric>
using namespace std;
vector<string> split(const string& input, char delim)
{
vector<string> result;
stringstream stream;
stream.str(input);
string token;
while (getline(stream, token, delim)) {
result.push_back(token);
}
return result;
}
int main(){
string input;
getline(cin,input);
vector<string> numbers = split(input,' ');
sort(numbers.begin(),numbers.end());
string smallest = accumulate(numbers.begin(),numbers.end(),string(""));
string biggest = accumulate(numbers.rbegin(),numbers.rend(),string(""));
cout << " biggest is " << biggest << endl;
cout << " smallest is " << smallest << endl;
return 0;
}
I2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8c3N0cmVhbT4KI2luY2x1ZGUgPG51bWVyaWM+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdmVjdG9yPHN0cmluZz4gc3BsaXQoY29uc3Qgc3RyaW5nJiBpbnB1dCwgY2hhciBkZWxpbSkKICAgIHsKICAgICAgICB2ZWN0b3I8c3RyaW5nPiByZXN1bHQ7CiAgICAgICAgc3RyaW5nc3RyZWFtIHN0cmVhbTsKICAgICAgICBzdHJlYW0uc3RyKGlucHV0KTsKICAgICAgICBzdHJpbmcgdG9rZW47CiAgICAgICAgd2hpbGUgKGdldGxpbmUoc3RyZWFtLCB0b2tlbiwgZGVsaW0pKSB7CiAgICAgICAgICAgIHJlc3VsdC5wdXNoX2JhY2sodG9rZW4pOwogICAgICAgIH0KICAgICAgICByZXR1cm4gcmVzdWx0OwogICAgfQoKaW50IG1haW4oKXsKICAgIHN0cmluZyBpbnB1dDsKICAgIGdldGxpbmUoY2luLGlucHV0KTsKICAgIHZlY3RvcjxzdHJpbmc+IG51bWJlcnMgPSBzcGxpdChpbnB1dCwnICcpOwogICAgc29ydChudW1iZXJzLmJlZ2luKCksbnVtYmVycy5lbmQoKSk7CiAgICBzdHJpbmcgc21hbG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