/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		System.out.println(gcd(98,56));
	}
	
	public static int gcd(int a, int b){
    if (a < b) {
        return gcd(b, a);
    }
    while(a%b!=0){
        b=a%b;
        a=b;
    }
    return b;
}
}