All problems

Choosing the Winning Class

easyPythonNaive Bayes

Two labels are in the running for a message and Halyard Mail's filter has already worked out a score for each. The scores sit on the logarithm scale, so they are usually negative, and that is where the arithmetic catches people out: a score of -2.1 beats a score of -3.2, even though 3.2 is the bigger-looking number. Halyard would rather the filter say nothing at all than pick a side it cannot justify, so a message it genuinely cannot separate goes to a human instead.

Task: Print the filter's decision.

Input

Two lines, one per label. Each holds a label and its score, separated by a single space; a label contains no spaces. A score may be negative, zero or positive.

Output

One line. If one score is strictly higher than the other, print that label. If the two scores match exactly, print tie instead. Only an exact match is a tie, however close two different scores happen to be.

Example:

Input:
spam -3.2
ham -2.1

Output:
ham

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…