#include<stdio.h>                                    //ÀîÃ÷Ç«
#include<stdlib.h>
#include<string.h>

int main()
{
	int L1, L2, score = 0, i = 0;
	char* str1, * str2;
	scanf("%d", &L1);
	str1 = (char*)malloc(sizeof(char) * (L1 + 1));
	scanf("%s", str1);
	scanf("%d", &L2);
	str2 = (char*)malloc(sizeof(char) * (L2 + 1));
	scanf("%s", str2);
	while (str1[i] != '\0' && str2[i] != '\0')
	{
		if (str1[i] > str2[i])
		{
			score++;
			break;
		}
		else
		{
			score--;
			break;
		}
		i++;
	}
	i = 0;
	while (str1[L1 - i] != '\0' && str2[L2 - i] != '\0')
	{
		if (str1[L1 - i] > str2[L2 - i])
		{
			score++;
			break;
		}
		else
		{
			score--;
			break;
		}
		i++;
	}
	if (str1[L1 / 2 - 1] > str2[L2 / 2 - 1])
		score++;
	else
		score--;
	if (strcmp(str1, str2) == 0 || score == 0)
		printf("str1 = str2\n");
	else if (score > 0)
		printf("str1 > str2\n");
	else if (score < 0)
		printf("str1 < str2\n");
	return 0;
}
