function g = ggT(m,n)

while m ~= n
  if m > n
    m = m - n;
  else
    n = n - m;
  end
end
g = n;