
import java.lang.*
import java.math.BigInteger
import java.util.LinkedHashMap

fun main(args: Array<String>) {
    val (A,B) = readLine()!!.split(" ").map(String::toInt)

    var baisuA = getBaisu(A)
    val baisuB = getBaisu(B)

    for(key in baisuB.keys){
        if(baisuA.containsKey(key)){
            baisuA[key] = Math.max(baisuA[key]!!,baisuB[key]!!)
        }else{
            baisuA[key] = baisuB[key]!!
        }
    }

    var answer = BigInteger.ONE
    for(key in baisuA.keys){
        var n = BigInteger(key.toString())
        answer = answer.multiply(n.pow(baisuA[key]!!))
    }

    println(answer)
}

fun getBaisu(A : Int,baisu : LinkedHashMap<Int,Int> = LinkedHashMap()) : LinkedHashMap<Int,Int>{

    if(A == 1){
        return baisu
    }

    for(i in 2..A){
        if((A%i)==0){
            if(!baisu.containsKey(i)){
                baisu[i] = 1
            }else{
                baisu[i] = baisu[i]!!+1
            }
            return getBaisu(A/i,baisu)
        }
    }

    return baisu
}