import java.io.*;
import java.util.*;

public class bacteria_sm {
	class Pair {
		int p, a;

		public Pair(int p, int a) {
			super();
			this.p = p;
			this.a = a;
		}

	}

	ArrayList<Pair> decomp(int n) {
		ArrayList<Pair> al = new ArrayList<Pair>();
		for (int i = 2; i * i <= n; i++) {
			if (n % i == 0) {
				int cnt = 0;
				while (n % i == 0) {
					cnt++;
					n /= i;
				}
				al.add(new Pair(i, cnt));
			}
		}
		if (n != 1) {
			al.add(new Pair(n, 1));
		}
		return al;
	}

	void solve() throws IOException {
		int n = nextInt();
		assert 1 <= n && n <= 1e9;
		int m = nextInt();
		assert 1 <= m && m <= 1e9;
		ArrayList<Pair> b = decomp(n);
		int[] a = new int[b.size()];
		for (int i = 0; i < a.length; i++) {
			while (m % b.get(i).p == 0) {
				m /= b.get(i).p;
				a[i]++;
			}
		}
		if (m != 1) {
			out.println("Impossible");
			return;
		}

		ArrayList<Integer> answer = new ArrayList<Integer>();
		while (true) {
			boolean need = false;
			for (int i = 0; i < a.length; i++) {
				if (a[i] > b.get(i).a) {
					need = true;
					break;
				}
			}
			if (!need)
				break;
			for (int i = 0; i < a.length; i++) {
				if (a[i] % 2 != 0) {
					a[i]++;
					answer.add(b.get(i).p);
				}
			}
			answer.add(0);
			for (int i = 0; i < a.length; i++) {
				a[i] /= 2;
			}
		}
		for (int i = 0; i < a.length; i++) {
			while (a[i] < b.get(i).a) {
				answer.add(b.get(i).p);
				a[i]++;
			}
		}
		Collections.reverse(answer);
		for (int i = 0; i < answer.size(); i++) {
			out.print(answer.get(i));
			if (i != answer.size() - 1) {
				out.print(" ");
			}
		}
		out.println();
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;

	final String filename = "bacteria";

	public void run() {
		try {
			br = new BufferedReader(new FileReader(filename + ".in"));
			out = new PrintWriter(filename + ".out");
			solve();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	String nextToken() {
		try {
			while (st == null || !st.hasMoreTokens()) {
				String s = br.readLine();
				if (s == null) {
					return null;
				}
				st = new StringTokenizer(s);
			}
			return st.nextToken();
		} catch (IOException e) {
			throw new RuntimeException();
		}
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	long nextLong() {
		return Long.parseLong(nextToken());
	}

	public static void main(String[] args) {
		new bacteria_sm().run();
	}
}
