import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String arg[]) {
		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int K = sc.nextInt();
		
		List <Integer> Adivisor = new ArrayList<Integer>();
		List <Integer> Bdivisor = new ArrayList<Integer>();
		List <Integer> ABdivisor = new ArrayList<Integer>();
		
		for(int i=1; i<=A; i++) {
			if(A%i==0) {
				Adivisor.add(A/i);
			}
		}
		
		for(int i=1; i<=B; i++) {
			if(B%i==0) {
				Bdivisor.add(B/i);
			}
		}
		
		for(int i=0; i<Adivisor.size(); i++) {
			for(int j=0; j<Bdivisor.size(); j++) {
				if(Adivisor.get(i)==Bdivisor.get(j)) {
					ABdivisor.add(Adivisor.get(i));
				}
			}
		}
		
		System.out.print(ABdivisor.get(K-1));
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String arg[]) {
		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int K = sc.nextInt();
		
		List <Integer> Adivisor = new ArrayList<Integer>();
		List <Integer> Bdivisor = new ArrayList<Integer>();
		List <Integer> ABdivisor = new ArrayList<Integer>();
		
		for(int i=1; i<=A; i++) {
			if(A%i==0) {
				Adivisor.add(A/i);
			}
		}
		
		for(int i=1; i<=B; i++) {
			if(B%i==0) {
				Bdivisor.add(B/i);
			}
		}
		
		for(int i=0; i<Adivisor.size(); i++) {
			for(int j=0; j<Bdivisor.size(); j++) {
				if(Adivisor.get(i)==Bdivisor.get(j)) {
					ABdivisor.add(Adivisor.get(i));
				}
			}
		}
		
		System.out.print(ABdivisor.get(K-1));
	}
} Main public static void main(String arg[]) {
		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int K = sc.nextInt();
		
		List <Integer> Adivisor = new ArrayList<Integer>();
		List <Integer> Bdivisor = new ArrayList<Integer>();
		List <Integer> ABdivisor = new ArrayList<Integer>();
		
		for(int i=1; i<=A; i++) {
			if(A%i==0) {
				Adivisor.add(A/i);
			}
		}
		
		for(int i=1; i<=B; i++) {
			if(B%i==0) {
				Bdivisor.add(B/i);
			}
		}
		
		for(int i=0; i<Adivisor.size(); i++) {
			for(int j=0; j<Bdivisor.size(); j++) {
				if(Adivisor.get(i)==Bdivisor.get(j)) {
					ABdivisor.add(Adivisor.get(i));
				}
			}
		}
		
		System.out.print(ABdivisor.get(K-1));
	} main {
		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int K = sc.nextInt();
		
		List <Integer> Adivisor = new ArrayList<Integer>();
		List <Integer> Bdivisor = new ArrayList<Integer>();
		List <Integer> ABdivisor = new ArrayList<Integer>();
		
		for(int i=1; i<=A; i++) {
			if(A%i==0) {
				Adivisor.add(A/i);
			}
		}
		
		for(int i=1; i<=B; i++) {
			if(B%i==0) {
				Bdivisor.add(B/i);
			}
		}
		
		for(int i=0; i<Adivisor.size(); i++) {
			for(int j=0; j<Bdivisor.size(); j++) {
				if(Adivisor.get(i)==Bdivisor.get(j)) {
					ABdivisor.add(Adivisor.get(i));
				}
			}
		}
		
		System.out.print(ABdivisor.get(K-1));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc List <Integer> Adivisor = new ArrayList<Integer>(); Adivisor new ArrayList<Integer>() List <Integer> Bdivisor = new ArrayList<Integer>(); Bdivisor new ArrayList<Integer>() List <Integer> ABdivisor = new ArrayList<Integer>(); ABdivisor new ArrayList<Integer>() for(int i=1; i<=A; i++) {
			if(A%i==0) {
				Adivisor.add(A/i);
			}
		} int i=1; int i=1; i 1 i<=A i A i++ i++ i {
			if(A%i==0) {
				Adivisor.add(A/i);
			}
		} {
			if(A%i==0) {
				Adivisor.add(A/i);
			}
		} if(A%i==0) {
				Adivisor.add(A/i);
			} A%i==0 A%i A i 0 {
				Adivisor.add(A/i);
			} Adivisor.add(A/i) Adivisor.add Adivisor A/i A i for(int i=1; i<=B; i++) {
			if(B%i==0) {
				Bdivisor.add(B/i);
			}
		} int i=1; int i=1; i 1 i<=B i B i++ i++ i {
			if(B%i==0) {
				Bdivisor.add(B/i);
			}
		} {
			if(B%i==0) {
				Bdivisor.add(B/i);
			}
		} if(B%i==0) {
				Bdivisor.add(B/i);
			} B%i==0 B%i B i 0 {
				Bdivisor.add(B/i);
			} Bdivisor.add(B/i) Bdivisor.add Bdivisor B/i B i for(int i=0; i<Adivisor.size(); i++) {
			for(int j=0; j<Bdivisor.size(); j++) {
				if(Adivisor.get(i)==Bdivisor.get(j)) {
					ABdivisor.add(Adivisor.get(i));
				}
			}
		} int i=0; int i=0; i 0 i<Adivisor.size() i Adivisor.size() Adivisor.size Adivisor i++ i++ i {
			for(int j=0; j<Bdivisor.size(); j++) {
				if(Adivisor.get(i)==Bdivisor.get(j)) {
					ABdivisor.add(Adivisor.get(i));
				}
			}
		} {
			for(int j=0; j<Bdivisor.size(); j++) {
				if(Adivisor.get(i)==Bdivisor.get(j)) {
					ABdivisor.add(Adivisor.get(i));
				}
			}
		} for(int j=0; j<Bdivisor.size(); j++) {
				if(Adivisor.get(i)==Bdivisor.get(j)) {
					ABdivisor.add(Adivisor.get(i));
				}
			} int j=0; int j=0; j 0 j<Bdivisor.size() j Bdivisor.size() Bdivisor.size Bdivisor j++ j++ j {
				if(Adivisor.get(i)==Bdivisor.get(j)) {
					ABdivisor.add(Adivisor.get(i));
				}
			} {
				if(Adivisor.get(i)==Bdivisor.get(j)) {
					ABdivisor.add(Adivisor.get(i));
				}
			} if(Adivisor.get(i)==Bdivisor.get(j)) {
					ABdivisor.add(Adivisor.get(i));
				} Adivisor.get(i)==Bdivisor.get(j) Adivisor.get(i) Adivisor.get Adivisor i Bdivisor.get(j) Bdivisor.get Bdivisor j {
					ABdivisor.add(Adivisor.get(i));
				} ABdivisor.add(Adivisor.get(i)) ABdivisor.add ABdivisor Adivisor.get(i) Adivisor.get Adivisor i System.out.print(ABdivisor.get(K-1)) System.out.print System.out System System.out ABdivisor.get(K-1) ABdivisor.get ABdivisor K-1 K 1 String arg[] arg public class Main {
	public static void main(String arg[]) {
		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int K = sc.nextInt();
		
		List <Integer> Adivisor = new ArrayList<Integer>();
		List <Integer> Bdivisor = new ArrayList<Integer>();
		List <Integer> ABdivisor = new ArrayList<Integer>();
		
		for(int i=1; i<=A; i++) {
			if(A%i==0) {
				Adivisor.add(A/i);
			}
		}
		
		for(int i=1; i<=B; i++) {
			if(B%i==0) {
				Bdivisor.add(B/i);
			}
		}
		
		for(int i=0; i<Adivisor.size(); i++) {
			for(int j=0; j<Bdivisor.size(); j++) {
				if(Adivisor.get(i)==Bdivisor.get(j)) {
					ABdivisor.add(Adivisor.get(i));
				}
			}
		}
		
		System.out.print(ABdivisor.get(K-1));
	}
} public class Main {
	public static void main(String arg[]) {
		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int K = sc.nextInt();
		
		List <Integer> Adivisor = new ArrayList<Integer>();
		List <Integer> Bdivisor = new ArrayList<Integer>();
		List <Integer> ABdivisor = new ArrayList<Integer>();
		
		for(int i=1; i<=A; i++) {
			if(A%i==0) {
				Adivisor.add(A/i);
			}
		}
		
		for(int i=1; i<=B; i++) {
			if(B%i==0) {
				Bdivisor.add(B/i);
			}
		}
		
		for(int i=0; i<Adivisor.size(); i++) {
			for(int j=0; j<Bdivisor.size(); j++) {
				if(Adivisor.get(i)==Bdivisor.get(j)) {
					ABdivisor.add(Adivisor.get(i));
				}
			}
		}
		
		System.out.print(ABdivisor.get(K-1));
	}
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String arg[]) {
		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int K = sc.nextInt();
		
		List <Integer> Adivisor = new ArrayList<Integer>();
		List <Integer> Bdivisor = new ArrayList<Integer>();
		List <Integer> ABdivisor = new ArrayList<Integer>();
		
		for(int i=1; i<=A; i++) {
			if(A%i==0) {
				Adivisor.add(A/i);
			}
		}
		
		for(int i=1; i<=B; i++) {
			if(B%i==0) {
				Bdivisor.add(B/i);
			}
		}
		
		for(int i=0; i<Adivisor.size(); i++) {
			for(int j=0; j<Bdivisor.size(); j++) {
				if(Adivisor.get(i)==Bdivisor.get(j)) {
					ABdivisor.add(Adivisor.get(i));
				}
			}
		}
		
		System.out.print(ABdivisor.get(K-1));
	}
}