import java.io.*;

class Main{
    
        public static int max(int i, int k){
            if(k < i){
                return i;
            }else{
                return k;
            }

        }

    public static void main(String[] args){

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {       
                    String line = reader.readLine();
                    String[] strAry = line.split(" ");

                    int[] a = new int[strAry.length];

                    for(int i = 0; i < strAry.length; i ++){
                        a[i] = Integer.parseInt(strAry[i]);
                    }
                    int x = a[0];
                    int y = a[1];

                    if(y > x){
                        int k = y;
                        y = x;
                        x = k;
                    }

                    int yaku = 0, k = 1;
                    for(int i = 0; i <= (x % y); i++){

                        int m = x % k;
                        int n = (x % y) % k;
                        if((m == 0) && (n == 0)){
                            yaku = k;
                        }
                        k += 1;
                    }

                    if(x == y){
                        yaku = x;
                    }

                    System.out.println(yaku);
            
                            
        } catch (IOException e) {
            //TODO: handle exception
            System.out.println(e);
        }
    }
} import java.io.*; io.* java class Main{
    
        public static int max(int i, int k){
            if(k < i){
                return i;
            }else{
                return k;
            }

        }

    public static void main(String[] args){

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {       
                    String line = reader.readLine();
                    String[] strAry = line.split(" ");

                    int[] a = new int[strAry.length];

                    for(int i = 0; i < strAry.length; i ++){
                        a[i] = Integer.parseInt(strAry[i]);
                    }
                    int x = a[0];
                    int y = a[1];

                    if(y > x){
                        int k = y;
                        y = x;
                        x = k;
                    }

                    int yaku = 0, k = 1;
                    for(int i = 0; i <= (x % y); i++){

                        int m = x % k;
                        int n = (x % y) % k;
                        if((m == 0) && (n == 0)){
                            yaku = k;
                        }
                        k += 1;
                    }

                    if(x == y){
                        yaku = x;
                    }

                    System.out.println(yaku);
            
                            
        } catch (IOException e) {
            //TODO: handle exception
            System.out.println(e);
        }
    }
} Main public static int max(int i, int k){
            if(k < i){
                return i;
            }else{
                return k;
            }

        } max {
            if(k < i){
                return i;
            }else{
                return k;
            }

        } if(k < i){
                return i;
            }else{
                return k;
            } k < i k i {
                return i;
            } return i; i {
                return k;
            } return k; k int i i int k k public static void main(String[] args){

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {       
                    String line = reader.readLine();
                    String[] strAry = line.split(" ");

                    int[] a = new int[strAry.length];

                    for(int i = 0; i < strAry.length; i ++){
                        a[i] = Integer.parseInt(strAry[i]);
                    }
                    int x = a[0];
                    int y = a[1];

                    if(y > x){
                        int k = y;
                        y = x;
                        x = k;
                    }

                    int yaku = 0, k = 1;
                    for(int i = 0; i <= (x % y); i++){

                        int m = x % k;
                        int n = (x % y) % k;
                        if((m == 0) && (n == 0)){
                            yaku = k;
                        }
                        k += 1;
                    }

                    if(x == y){
                        yaku = x;
                    }

                    System.out.println(yaku);
            
                            
        } catch (IOException e) {
            //TODO: handle exception
            System.out.println(e);
        }
    } main {

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {       
                    String line = reader.readLine();
                    String[] strAry = line.split(" ");

                    int[] a = new int[strAry.length];

                    for(int i = 0; i < strAry.length; i ++){
                        a[i] = Integer.parseInt(strAry[i]);
                    }
                    int x = a[0];
                    int y = a[1];

                    if(y > x){
                        int k = y;
                        y = x;
                        x = k;
                    }

                    int yaku = 0, k = 1;
                    for(int i = 0; i <= (x % y); i++){

                        int m = x % k;
                        int n = (x % y) % k;
                        if((m == 0) && (n == 0)){
                            yaku = k;
                        }
                        k += 1;
                    }

                    if(x == y){
                        yaku = x;
                    }

                    System.out.println(yaku);
            
                            
        } catch (IOException e) {
            //TODO: handle exception
            System.out.println(e);
        }
    } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) try {       
                    String line = reader.readLine();
                    String[] strAry = line.split(" ");

                    int[] a = new int[strAry.length];

                    for(int i = 0; i < strAry.length; i ++){
                        a[i] = Integer.parseInt(strAry[i]);
                    }
                    int x = a[0];
                    int y = a[1];

                    if(y > x){
                        int k = y;
                        y = x;
                        x = k;
                    }

                    int yaku = 0, k = 1;
                    for(int i = 0; i <= (x % y); i++){

                        int m = x % k;
                        int n = (x % y) % k;
                        if((m == 0) && (n == 0)){
                            yaku = k;
                        }
                        k += 1;
                    }

                    if(x == y){
                        yaku = x;
                    }

                    System.out.println(yaku);
            
                            
        } catch (IOException e) {
            //TODO: handle exception
            System.out.println(e);
        } catch (IOException e) {
            //TODO: handle exception
            System.out.println(e);
        } IOException e {
            //TODO: handle exception
            System.out.println(e);
        } System.out.println(e) System.out.println System.out System System.out e {       
                    String line = reader.readLine();
                    String[] strAry = line.split(" ");

                    int[] a = new int[strAry.length];

                    for(int i = 0; i < strAry.length; i ++){
                        a[i] = Integer.parseInt(strAry[i]);
                    }
                    int x = a[0];
                    int y = a[1];

                    if(y > x){
                        int k = y;
                        y = x;
                        x = k;
                    }

                    int yaku = 0, k = 1;
                    for(int i = 0; i <= (x % y); i++){

                        int m = x % k;
                        int n = (x % y) % k;
                        if((m == 0) && (n == 0)){
                            yaku = k;
                        }
                        k += 1;
                    }

                    if(x == y){
                        yaku = x;
                    }

                    System.out.println(yaku);
            
                            
        } String line = reader.readLine(); line reader.readLine() reader.readLine reader String[] strAry = line.split(" "); strAry line.split(" ") line.split line " " int[] a = new int[strAry.length]; a new int[strAry.length] strAry.length strAry strAry.length for(int i = 0; i < strAry.length; i ++){
                        a[i] = Integer.parseInt(strAry[i]);
                    } int i = 0; int i = 0; i 0 i < strAry.length i strAry.length strAry strAry.length i ++ i ++ i {
                        a[i] = Integer.parseInt(strAry[i]);
                    } {
                        a[i] = Integer.parseInt(strAry[i]);
                    } a[i] = Integer.parseInt(strAry[i]) a[i] a i Integer.parseInt(strAry[i]) Integer.parseInt Integer strAry[i] strAry i int x = a[0]; x a[0] a 0 int y = a[1]; y a[1] a 1 if(y > x){
                        int k = y;
                        y = x;
                        x = k;
                    } y > x y x {
                        int k = y;
                        y = x;
                        x = k;
                    } int k = y; k y y = x y x x = k x k int yaku = 0 yaku 0 k = 1; k 1 for(int i = 0; i <= (x % y); i++){

                        int m = x % k;
                        int n = (x % y) % k;
                        if((m == 0) && (n == 0)){
                            yaku = k;
                        }
                        k += 1;
                    } int i = 0; int i = 0; i 0 i <= (x % y) i (x % y) x y i++ i++ i {

                        int m = x % k;
                        int n = (x % y) % k;
                        if((m == 0) && (n == 0)){
                            yaku = k;
                        }
                        k += 1;
                    } {

                        int m = x % k;
                        int n = (x % y) % k;
                        if((m == 0) && (n == 0)){
                            yaku = k;
                        }
                        k += 1;
                    } int m = x % k; m x % k x k int n = (x % y) % k; n (x % y) % k (x % y) x y k if((m == 0) && (n == 0)){
                            yaku = k;
                        } (m == 0) && (n == 0) (m == 0) m 0 (n == 0) n 0 {
                            yaku = k;
                        } yaku = k yaku k k += 1 k 1 if(x == y){
                        yaku = x;
                    } x == y x y {
                        yaku = x;
                    } yaku = x yaku x System.out.println(yaku) System.out.println System.out System System.out yaku String[] args args
import java.io.*;

class Main{
    
        public static int max(int i, int k){
            if(k < i){
                return i;
            }else{
                return k;
            }

        }

    public static void main(String[] args){

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {       
                    String line = reader.readLine();
                    String[] strAry = line.split(" ");

                    int[] a = new int[strAry.length];

                    for(int i = 0; i < strAry.length; i ++){
                        a[i] = Integer.parseInt(strAry[i]);
                    }
                    int x = a[0];
                    int y = a[1];

                    if(y > x){
                        int k = y;
                        y = x;
                        x = k;
                    }

                    int yaku = 0, k = 1;
                    for(int i = 0; i <= (x % y); i++){

                        int m = x % k;
                        int n = (x % y) % k;
                        if((m == 0) && (n == 0)){
                            yaku = k;
                        }
                        k += 1;
                    }

                    if(x == y){
                        yaku = x;
                    }

                    System.out.println(yaku);
            
                            
        } catch (IOException e) {
            //TODO: handle exception
            System.out.println(e);
        }
    }
}