import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Queue;
import java.util.Set;
import java.util.StringTokenizer;

public class bacteria_sm_bfs {
	class State {
		long x;
		State from;

		public State(long x, State from) {
			super();
			this.x = x;
			this.from = from;
		}

	}

	void solve() throws IOException {
		int n = nextInt();
		assert 1 <= n && n <= 1e9;
		int m = nextInt();
		assert 1 <= m && m <= 1e9;
		Queue<State> q = new ArrayDeque<State>();
		q.add(new State(n, null));
		Set<Long> hs = new HashSet<Long>();
		hs.add((long) n);
		while (!q.isEmpty()) {
			State st = q.poll();
			if (st.x == m) {
				ArrayList<Long> ans = new ArrayList<Long>();
				while (st.from != null) {
					if (st.x == st.from.x * st.from.x) {
						ans.add(0L);
					} else {
						ans.add(st.from.x / st.x);
					}
					st = st.from;
				}
				Collections.reverse(ans);
				for (long i : ans) {
					out.print(i + " ");
				}
				return;
			}
			for (int i = 2; i <= n; i++) {
				if (st.x % i == 0 && BigInteger.valueOf(i).isProbablePrime(100) && !hs.contains(st.x / i)) {
					long nb = st.x / i;
					hs.add(nb);
					q.add(new State(nb, st));
				}
			}
			if (st.x <= Integer.MAX_VALUE && !hs.contains(st.x * st.x)) {
				long nb = st.x * st.x;
				hs.add(nb);
				q.add(new State(nb, st));
			}
		}
		out.println("Impossible");
	}

	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_bfs().run();
	}
}
