A complete deck of playing cards contains 52 regular cards that are grouped into four suits of 13 cards each: 13 spades (), 13 hearts (), 13 clubs () and 13 diamonds (). Spades and clubs are black. Hearts and diamonds are red. Each suit has cards of the following values: 2 to 10, a jack, a queen, a king and an ace. Some decks also contain two or three jokers, but they are a relatively recent invention and lack any standardized appearance, so each publisher usually puts their own trademarked illustration into their decks.

Card mates play an important role in many card games and magic tricks. Two cards are mates if they have the same value and color, without the two cards being exactly the same. For example, the queen of clubs and the queen of spades are mates.

mate pair of queens
mate pair of queens

Consider for example the following remarkable spelling trick by American magician Howard Adams. From a deck of cards choose five cards and their mates. Arrange the cards in the order ABCDEabcde, where ABCDE are the chosen cards and abcde are the mates. Cut this packet as many times as you like, then deal five cards onto the table, reversing their order. Place the remaining five cards beside them in a second pile.

Now spell the phrase "LAST TWO CARDS MATCH". As you say L, choose either pile at random and transfer a card from the top to the bottom. Do the same for A, S, and T. Now remove the top card from each pile and set them aside as a pair. Perform the same procedure as you spell TWO, CARDS, and MATCH. When you're finished, two cards will remain on the table. Not only do these cards match as mates, but so do each of the other pairs!

Input

There are four lines of input. The first two lines respectively contain the suit and the value of a first card. The last two lines respectively contain the suit and the value of a second card. The names of suits and values only contain lowercase letters and digits.

Output

A single line that indicates whether the two given cards are mates. Look at the examples below to see how the output must be formatted.

Example

Input:

spades
ace
clubs
ace

Output:

the ace of spades and the ace of clubs are mates

Example

Input:

hearts
7
diamonds
queen

Output:

the 7 of hearts and the queen of diamonds are not mates

Example

Input:

diamonds
jack
spades
jack

Output:

the jack of diamonds and the jack of spades are not mates