#include <stdio.h>
int main()
{
    int n1,n2,n3,K,gcd;

    printf("Enter three integers: ");
    scanf("%d%d%d",&n1,&n2,&n3);

    for(K=1;K<=n1&&K<=n2&&K<=n3;++K)
    {
        if(n1%K==0&&n2%K==0&&n3%K==0)
            gcd = K;
    }

    printf("G.C.D of %d and %d and %d is %d", n1, n2,n3, gcd);

    return 0;
}