// Geoff Hagopian -- PPP3 Ex 6

#include <iostream>
#include <string>

using namespace std;
int main()
{
	string str1, str2, str3;
	cout << "Enter three strings: ";
	cin >> str3 >> str2 >> str1;
	if (str1 < str2)
	{
		if (str1 < str3)
		{
			if (str2 < str3)
			{
				cout << str1 + ", " + str2 + ", " + str3 << endl;
			}
			else
			{
				cout << str1 + ", " + str3 + ", " + str2 << endl;
			}
		}
		else
		{
			cout << str3 + ", " + str1 + ", " + str2 << endl;
		}
	}
	else
	{
		if (str1 < str3)
		{
			cout << str2 + ", " + str1 + ", " + str3 << endl;
		}
		else
		{
			if (str2 < str3)
			{
				cout << str2 + ", " + str3 + ", " + str1 << endl;
			}
			else
			{
				cout << str3 + ", " + str2 + ", " + str1 << endl;
			}
		}
	}

	return 0;
}
