import java.util.*;
import java.lang.*;
import java.io.*;
// The main method must be in a class named "Main".
class Main {
public static void main(String[] args) {
// System.out.println("Hello world!");
Scanner s = new Scanner(System.in);
int a = s.nextInt();
int b = s.nextInt();
int n = Math.min(a,b);
int num = 0;
for (int i = 1 ; i <=n ; i++){
if (a%i ==0 && b%i ==0 )
num = i;
}
System.out.println(num);
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: