Tri-du

Given two known card values, pick a third value from 1 to 13 that maximizes the chance of holding a winning triple or pair against one opponent.

Medium5MathProbabilityBrute forceNo attempts yetTime limit1sMemory limit512 MB

Problem

Tri-du is a card game derived from Truco. It uses one standard deck of 52 cards with thirteen cards in each suit, but suits have no effect on the result. Only the card values matter, and every value is an integer from 11 to 1313.

In one round each player receives three cards. The rules are short.

  • A triple (three cards of the same value) beats a pair (two cards of the same value).
  • Between two triples, the one made of the higher value wins.
  • Between two pairs, the one made of the higher value wins.

Many rounds end with no winner. In that case the dealt cards go back into the deck, the deck is shuffled, and a new round starts.

One player has already received two of the three cards and knows their values. Write a program that finds the value of the third card that maximizes this player's probability of winning the round.

Input

The first line contains two integers AA and BB, separated by one space, the values of the two cards already received. (1A131 \le A \le 13, 1B131 \le B \le 13)

Output

Print one line with a single integer, the value of the third card that maximizes the probability of winning.