[白俊1850]最大公約数


package d0222;

import java.util.Scanner;

public class 최대공약수 {
	static Long cnt;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		long n = sc.nextLong();
		long m = sc.nextLong();
		long result = gcd(n,m);
		//result = (long) (Math.pow(2, result))-1;
		//System.out.println(Long.toBinaryString(result));
		StringBuilder sb = new StringBuilder();
		
		for(int i=0;i<result;i++) {
			sb.append(1);
		}
		System.out.println(sb);
	}
	public static long gcd(long n,long m) {
		if(m==0) return n;
		return gcd(m,n%m);
	}
	
}