a, b = map(int, input().split())while b != 0: a, b = b, a % bprint(a)
6 9
3
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!