Under construction

Still being built. Things may change

Drum

Interview

Time limit1sMemory limit1024 MB

Summary
Given hit counts X (left hand) and Y (right hand) per beat, print the order of hits in one beat: 1 for left, 2 for right, 3 for both.
Level

Easy2 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

Yeonghyeon, who is just starting to learn the drums, has a problem. Drumming depends on timing, but Yeonghyeon has serious trouble keeping the beat.

Sometimes the left and right hands must play in different rhythms. If the left hand must play XX times and the right hand YY times in one beat, the left hand plays every 1/X1/X beat and the right hand plays every 1/Y1/Y beat. For X=2X=2 and Y=3Y=3, the order is (right) / (left) / (right) / (left + right), as shown in the figure.

When Yeonghyeon faces this situation, he cannot play at all. Find the order in which the drum should be played to help him.

Input

Two integers XX and YY are given on one line. XX is the number of times the left hand must play in one beat, and YY is the number of times the right hand must play in one beat. (1≤X,Y≤1001 \le X, Y \le 100)

Output

Print the order in which the drum is played. Print 1 if only the left hand plays, 2 if only the right hand plays, and 3 if both hands play.

Examples2

  1. Example 1

    Input
    2 3
    
    Expected output
    2123
    
  2. Example 2

    Input
    4 2
    
    Expected output
    1313