Yo`nalishlar
Hozirda online

Statistika

Masalalar soni: 909

Foydalanuvchilar soni: 8819

Jo'natishlar soni: 714318

Muhokama yozuvlari: 4540

Yangiliklar soni: 97

Yangiliklar izohlari: 1174


So'ngi izohlar

722. Massive Numbers
Vaqt limiti: 1 sekund
Xotira limiti: 64 MB

 The number is called massive if it is represented in the form  a^n, which means a raised in power n. You need to compare two massive numbers ab and cd, written in the form “<base>^<exponent>”.

   Given two massive numbers, print the biggest one.

   Input

  Two massive numbers a and b in the form “<base>^<exponent>”. It is known that 1 ≤ <base>, <exponent> ≤ 20000. It is guaranteed that given numbers are not equal.

   Output

   The biggest number among a and b.

Samples

Input

Output

1

3^100 2^150

3^100

2

1^1000 2^1

2^1

 

Tayyorladi: Azat Yusupov
Text from: e-olimp.com
Mening urinishlarim(0) Muhokama (0) Jo'natish Eng yaxshi yechimlar Barcha muvaffaqiyatli urinishlar(80) Barcha urinishlar(184)