#include<stdio.h>

void gcd(int a,int b){
    while (b !=0) {
        int temp =b;
        b = a % b;
        a = temp;
    }
    return 0;
}
int main(){
    int a,b;
    printf("Enter two numbers:");
    scanf("%d %d", &a, &b);
    
    if (a < 0 || b < 0) {
        printf("Invalid Input\n");
    } else {
        int result = gcd(a, b);
        printf("GCD is:%d\n", result);
    }
    return 0;
}