#0005DE

O-NZD

Find greatest common divisor for numbers H and B.


InputIn first line of input is hexadecimal number H.
In second line of input is binary number B.

OutputIn first line of output write GCD for H and B in decimal notation.

NOTICE: All numbers are < 2^64



Input:
CC
100100

Output:
12


Explanation: hexadecimal number CC is decimal 204 and binary number 100100 is decimal 36. GCD(204,36) is 12.

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.