#include <iostream>
using namespace std;

int main() {
	long double x, y, z, min, max;
	int counter, number;
	counter = 1;
	number = 1;
	cin >> x >> y >> z;
	min = 0;
	min = x;
    if(y < min){
		min = y;
		counter = 1;
	}
    else if(y == min){
		counter ++;
	}
    if(z < min){
		min = z;
		counter = 1;
	}
	else if (z == min){
		counter++;
	}
	max = 0;
	max = y;
	if(x > max){
		max = x;
		number = 1;
	}
	else if(x == max){
		number ++;
	}
    if(z > max){
		max = z;
		number = 1;
	}
    else if(z == max){
		number ++;
	}
	if(counter !=1 ){
		cout << min << "("<<counter<<")" << endl;
	}
	else {
		cout << min << endl;
	}
	if(number != 1){
		cout << max << "("<<number<<")" << endl;
	}
	else {
		cout << max << endl;
	}
	return 0;
}