def gcd(numbers):
    """Calculates greatest common divisor of a list of numbers."""
    
    aa = numbers[0]
    for bb in numbers[1:]:
        while bb:
            aa, bb = bb, aa % bb
    return aa