#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <regex>

using namespace std;

bool myless(char l, char r) {
	return (int)l < (int)r;
}


int main()
{
	string num1, num2;
	cin >> num1 >> num2;

	auto pred = [](char ch){ return myless('0', ch) && !myless('9', ch); };

	auto it1 = stable_partition(num1.begin(), num1.end(), pred);
	num1.erase(it1, num1.end());
	auto it2 = stable_partition(num2.begin(), num2.end(), pred);
	num2.erase(it2, num2.end());

	cout << num1 << endl;
	cout << num2 << endl;


//	if (!regex_match(num1, regex("[0-9]+")))
//		cout << "invalid num" << endl;
//	if (!regex_match(num2, regex("[0-9]+")))
//		cout << "invalid num" << endl;

	if (num1.size() < num2.size())
		cout << num1 + " is less than " + num2 << endl;
	else if(num1.size() > num2.size())
		cout << num1 + " is greater than " + num2 << endl;
	else
	{
//		auto mypair = mismatch(num1.cbegin(), num1.cend(), num2.cbegin());
//		if (mypair.first==num1.cend())
//			cout << num1 + " is equal to " + num2 << endl;
//		else if (myless(*mypair.first,*mypair.second))
//			cout << num1 + " is less than " + num2 << endl;
//		else /*if (myless(*mypair.second, *mypair.first))*/
//			cout << num1 + " is greater than " + num2 << endl;
		if(num1<num2)
			cout << num1 + " is less than " + num2 << endl;
		else if(num1>num2)
			cout << num1 + " is greater than " + num2 << endl;
		else
			cout << num1 + " is equal to " + num2 << endl;
	}
}