using System; using System.Collections.Generic; using System.Collections; using System.Linq; using System.Numerics; namespace contest { class contest { static void Main(string[] args) { //int n = int.Parse(Console.ReadLine()); //var input = Console.ReadLine().Split().Select(int.Parse).ToArray(); //var num = Console.ReadLine().Split().Select(int.Parse).ToArray(); var input = Console.ReadLine().Split().Select(BigInteger.Parse).ToArray(); BigInteger A = input[0]; BigInteger B = input[1]; Console.WriteLine(gcd((A+B),(A*B))); } public static BigInteger gcd(BigInteger a, BigInteger b) { if (a < b) return gcd(b,a); if (a % b == 0) return b; return gcd(b, a%b); } } }