# https://open.kattis.com/problems/gcd
# 1s
# 1.7 Easy

# 37 chars Not short enough for Top 10 (13..36)
a,b=gets.split.map(&:to_i)
p a.gcd(b)
