PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000010. Ước chung lớn nhất của cả đoạn (Complicated GCD)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Ước chung lớn nhất của cả đoạn (Complicated GCD)

Complicated GCD

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given positive decimal integers a≤ba\le b that may be extremely large, find the greatest common divisor of every integer in the inclusive range a,a+1,…,ba,a+1,\ldots,b. The values can exceed 64-bit integer capacity.

Input

One line contains decimal integers a,ba,b.

Output

Print the GCD of the entire interval.

Subtasks

  • Subtask 1 (20 points): 1≤a≤b≤1001 \le a \le b \le 100
  • Subtask 2 (30 points): 1≤a≤b≤10151 \le a \le b \le 10^{15}
  • Subtask 3 (50 points): 1≤a≤b≤101001 \le a \le b \le 10^{100}

Examples

Input

1 2

Output

1

Explanation

The interval contains consecutive integers 1,21,2, whose GCD is 11.