The leaders of Russia have been alternately bald and hairy since 1881.

Alexander III (1881-1894) Nicholas II (1894-1917) Vladimir Lenin (1870-1924) Joseph Stalin (1924-1953) Nikita Khrushchev (1955-1964) Leonid Brezhnev (1964-1982) Yuri Andropov (1982-1984)
Konstantin Chernenko (1982-1984) Mikhail Gorbachev (1985-1991) Boris Yeltsin (1991-1999) Vladimir Putin (2000-2008) Dmitry Medvedev (2008-2012) Vladimir Putin (2012-present)  

And monarchs' profiles on British coins have faced alternately left and right since 1653. The exception is Edward VIII, who stares obstinately at the back of George V's head.

Oliver Cromwell Charles II James II William and Mary Anne George I George II George III
George IV William IV Victoria Edward VII George V Edward VIII George VI Elizabeth II

Assignment

For a given sequence of items, determine if they have alternating values for one of their properties. For non-alternating sequences we also want to check if there is a single exception that would make the sequence alternating if it would have another value for the property.

Input

A sequence of two or more items. Each item is described on a separate line by its name, a tab and its value for a particular property of the items. We guarantee that the first two items have different values for this property. The sequence ends with a line containing the word stop.

Output

In case all items in the sequence have alternating values for the property, the output should contain the text alternating sequence. Otherwise the output should contain the text no alternating sequence, unless there is one exception that would make the sequence alternating if it would have another value for the property. In the latter case, the output should contain the text alternating sequence with one exception: name, where name must be filled up with the name of the exceptional item.

Example

Input:

Alexander III	bald
Nicholas II	hairy
Vladimir Lenin	bald
Joseph Stalin	hairy
Nikita Khrushchev	bald
Leonid Brezhnev	hairy
Yuri Andropov	bald
Konstantin Chernenko	hairy
Mikhail Gorbachev	bald
Boris Yeltsin	hairy
Vladimir Putin	bald
Dmitry Medvedev	hairy
Vladimir Putin	bald
stop

Output:

alternating sequence

Example

Input:

Oliver Cromwell	left
Charles II	right
James II	left
William & Mary	right
Anne	left
George I	right
George II	left
George III	right
George IV	left
William IV	right
Victoria	left
Edward VII	right
George V	left
Edward VIII	left
George VI	left
Elizabeth II	right
stop

Output:

alternating sequence with one exception: Edward VIII

Example

Input:

January	31
February	29
March	31
April	30
May	31
June	30
July	31
August	31
September	30
October	31
November	30
December	31
stop

Output:

no alternating sequence