#include<stdio.h>
int main()
{
	int a,b,c,d,e;
	printf("Input is given from Standard Input in the following format:");
	scanf("%d%d%d",&a,&b,&c);
	if(a!=b||a!=c||b!=c)
	{
		if(a>=b&&a>=c) d=b,e=c;
		if(b>=a&&b>=c) d=c,e=a;
		if(c>=a&&c>=b) d=a,e=b;
		printf("%d\nBuying a %d-yen bell and a %d-yen bell costs %d yen.\n",d+e,a,b,a+b);
		printf("Buying a %d-yen bell and a %d-yen bell costs %d yen.\n",a,c,a+c);
		printf("Buying a %d-yen bell and a %d-yen bell costs %d yen.\n",b,c,c+b);
		printf("The minimum among these is %d yen.",d+e);
	}
	else
	{
		printf("%d\nBuying any two bells costs %d yen.",a+b,a+b);
	}
	return 0;
}