Under construction

Still being built. Things may change

A Duel of Two Proud Geniuses

Time limit0.5sMemory limit1024 MB

Summary
Given A in base u and B in base v, each with up to 3,000,000 digits of equal length, decide whether A is larger, B is larger, or they are equal.
Level

Medium7 of 10

Topics
Math, String, Implementation
Solved
No attempts yet

Problem

Right now, the Erica campus of Hanyang University is in the middle of a craze over Erica-Card, a 1:1 card battle game. Each player places one card, and the player whose card shows the higher combat power (전투력) wins.

Ras and Auq are two geniuses with strong pride, and they want to settle their ranking through Erica-Card. However, Ras's combat power AA is written as a uu-ary integer, and Auq's combat power BB is written as a vv-ary integer, so they have trouble playing the game. The two numbers have the same length. In other words, each combat power has the same number of digits.

Look at the cards each player placed and determine who won.

Input

The first line contains two integers uu and vv, separated by a space. (2≤u,v≤10)(2 \leq u, v \leq 10)

The second line contains Ras's combat power AA written in base uu. (0≤A<u3 000 000)(0 \leq A < u^{3\,000\,000})

The third line contains Auq's combat power BB written in base vv. (0≤B<v3 000 000)(0 \leq B < v^{3\,000\,000})

AA and BB have no leading zeros, except when the value is 00.

Output

On the first line, print ras if Ras wins, auq if Auq wins, or rasauq if the combat powers are equal and neither player wins.

Examples3

  1. Example 1

    Input
    10 4
    1122
    2211
    
    Expected output
    ras
    
  2. Example 2

    Input
    3 4
    1122
    2211
    
    Expected output
    auq
    
  3. Example 3

    Input
    5 4
    1234
    3002
    
    Expected output
    rasauq