let input = readLine()!.split(separator: " ").map{ Int(String($0))! }
let gcd = findGcd(input[0], input[1])
print(String(repeating: "1", count: gcd))
func findGcd(_ A: Int, _ B: Int) -> Int {
if A % B == 0 {
return B
}
return findGcd(B, A % B)
}