Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/string-ikkilik-qoshish

Add binary numbers

Medium 1000 ms 64 MB 65%
Share

Two non-negative numbers $a$ and $b$ written in binary are given; they may be very long. Print their sum in binary (without unnecessary zeros).

Adding two binary numbers in a column, with the carried ones on top

Input

The first line contains $a$, the second line $b$.

Output

The binary representation of the sum.

Note

$1 \le |a|, |b| \le 10^{5}$
the numbers consist only of 0 and 1 and do not start with 0 unless the number is $0$ itself

Examples

Input #1
1011
110
Output #1
10001
Input #2
0
0
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.