CodeLab Academy 📞 9936 6696
← List Python · Level 5: While loops Code · 50 points ← #403 #405 →

#404. GCD (Euclid's algorithm)

You get two positive integers. Use `while` to find their greatest common divisor. ### Input One line: a b (1 ≤ a, b ≤ 10⁶). ### Output One integer.

Examples

Input
8127 16684
Output
43
Input
5978 1778
Output
14

💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!