Exchange

Time limit1sMemory limit128 MB

Statement

Dave has obtained, in advance, the exchange rates of the US dollar against the German mark for several upcoming days.

Dave starts with 100 marks. On each day he may, using that day's rate, convert all of his money from marks to dollars or from dollars to marks, or leave it unchanged. Write a program that decides when to buy and sell so that the amount of marks Dave holds at the end of the last day is as large as possible.

Input

The first line contains a natural number $N$ ($1 \le N \le 100$), the number of future days.

Each of the next $N$ lines contains two natural numbers $B$ and $S$ ($100 \le B \le S \le 1000$) separated by a space. Line $i+1$ describes the rate on day $i$.

The two numbers mean the following:

  • On that day 100 marks buy $B$ dollars; i.e. converting marks to dollars gives (dollars) $=$ (marks) $\times B / 100$.
  • On that day $S$ dollars buy 100 marks; i.e. converting dollars to marks gives (marks) $=$ (dollars) $\times 100 / S$.

Output

Print, on a single line, the maximum amount of marks Dave can hold after the last day, as an irreducible fraction $p/q$ with $q \ge 1$ and $\gcd(p, q) = 1$. If the amount is an integer $v$, print it as $v/1$.