# algorytm euklidesa
a=4
b=8
while a!=b:
if a>b:
a=a-b
if a<b:
b=b-a
print(a)
def nwd(a,b):
while a!=b:
if a>b:
a=a-b
elif a<b:
b=b-a
return a
print(nwd(18,24))
IyBhbGdvcnl0bSBldWtsaWRlc2EKYT00CmI9OAp3aGlsZSBhIT1iOgoJaWYgYT5iOgoJCWE9YS1iCglpZiBhPGI6CgkJYj1iLWEKcHJpbnQoYSkKZGVmIG53ZChhLGIpOgoJd2hpbGUgYSE9YjoKCQlpZiBhPmI6CgkJCWE9YS1iCgkJZWxpZiBhPGI6CgkJCWI9Yi1hCgkJcmV0dXJuIGEgCnByaW50KG53ZCgxOCwyNCkp