using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Kfactorization
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();

            int n = int.Parse(s[0]);
            int k = int.Parse(s[1]);

            List<int> factors = new List<int>();

            int p = 2;

            while (n>1 && factors.Count<k-1)
            {
                if (n%p==0)
                {
                    factors.Add(p);
                    n /= p;
                }
                else
                {
                    p++;
                }
            }

            if (n > 1) factors.Add(n);

            if (factors.Count==k)
            {
                foreach (var factor in factors)
                {
                    Console.Write("{0} ", factor);
                }
            }
            else
            {
                Console.Write(-1);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using static System.Console;
using static System.Convert;
using static System.Math;
using static Template;
using Pi = Pair<int, int>;

class Solver
{

    public void Solve(Scanner sc)
    {
        int N, K;
        sc.Make(out N, out K);
        var f = Factorize(N);
        var res = new List<long>();
        var rest = 1L;
        foreach(var e in f)
        {
            var a = e.Value;
            while (res.Count != K-1&&a>0)
            {
                res.Add(e.Key);a--;
            }
            rest *= (long)Pow(e.Key, a);
        }
        if (rest == 1) Fail(-1);
        res.Add(rest);
        Console.WriteLine(string.Join(" ", res));
    }

    public static Dictionary<long, int> Factorize(long num)
    {
        var dic = new Dictionary<long, int>();
        for (var i = 2L; i * i <= num; i++)
        {
            var ct = 0;
            while (num % i == 0)
            {
                ct++;
                num /= i;
            }
            if (ct != 0) dic[i] = ct;
        }
        if (num != 1) dic[num] = 1;
        return dic;
    }
}

#region Template
public static class Template
{
    static void Main(string[] args)
    {
        Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
        new Solver().Solve(new Scanner());
        Console.Out.Flush();
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmin<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) > 0) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmax<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static void swap<T>(ref T a, ref T b) { var t = b; b = a; a = t; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static void swap<T>(this IList<T> A, int i, int j) { var t = A[i]; A[i] = A[j]; A[j] = t; }
    public static T[] Create<T>(int n, Func<T> f) { var rt = new T[n]; for (var i = 0; i < rt.Length; ++i) rt[i] = f(); return rt; }
    public static T[] Create<T>(int n, Func<int, T> f) { var rt = new T[n]; for (var i = 0; i < rt.Length; ++i) rt[i] = f(i); return rt; }
    public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> A) => A.OrderBy(v => Guid.NewGuid());
    public static int CompareTo<T>(this T[] A, T[] B, Comparison<T> cmp = null) { cmp = cmp ?? Comparer<T>.Default.Compare; for (var i = 0; i < Min(A.Length, B.Length); i++) { int c = cmp(A[i], B[i]); if (c > 0) return 1; else if (c < 0) return -1; } if (A.Length == B.Length) return 0; if (A.Length > B.Length) return 1; else return -1; }
    public static int MaxElement<T>(this IList<T> A, Comparison<T> cmp = null) { cmp = cmp ?? Comparer<T>.Default.Compare; T max = A[0]; int rt = 0; for (int i = 1; i < A.Count; i++) if (cmp(max, A[i]) < 0) { max = A[i]; rt = i; } return rt; }
    public static T PopBack<T>(this List<T> A) { var v = A[A.Count - 1]; A.RemoveAt(A.Count - 1); return v; }
    public static void Fail<T>(T s) { Console.WriteLine(s); Console.Out.Close(); Environment.Exit(0); }
}
public class Scanner
{
    public string Str => Console.ReadLine().Trim();
    public int Int => int.Parse(Str);
    public long Long => long.Parse(Str);
    public double Double => double.Parse(Str);
    public int[] ArrInt => Str.Split(' ').Select(int.Parse).ToArray();
    public long[] ArrLong => Str.Split(' ').Select(long.Parse).ToArray();
    public char[][] Grid(int n) => Create(n, () => Str.ToCharArray());
    public int[] ArrInt1D(int n) => Create(n, () => Int);
    public long[] ArrLong1D(int n) => Create(n, () => Long);
    public int[][] ArrInt2D(int n) => Create(n, () => ArrInt);
    public long[][] ArrLong2D(int n) => Create(n, () => ArrLong);
    private Queue<string> q = new Queue<string>();
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public T Next<T>() { if (q.Count == 0) foreach (var item in Str.Split(' ')) q.Enqueue(item); return (T)Convert.ChangeType(q.Dequeue(), typeof(T)); }
    public void Make<T1>(out T1 v1) => v1 = Next<T1>();
    public void Make<T1, T2>(out T1 v1, out T2 v2) { v1 = Next<T1>(); v2 = Next<T2>(); }
    public void Make<T1, T2, T3>(out T1 v1, out T2 v2, out T3 v3) { Make(out v1, out v2); v3 = Next<T3>(); }
    public void Make<T1, T2, T3, T4>(out T1 v1, out T2 v2, out T3 v3, out T4 v4) { Make(out v1, out v2, out v3); v4 = Next<T4>(); }
    public void Make<T1, T2, T3, T4, T5>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5) { Make(out v1, out v2, out v3, out v4); v5 = Next<T5>(); }
    public void Make<T1, T2, T3, T4, T5, T6>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5, out T6 v6) { Make(out v1, out v2, out v3, out v4, out v5); v6 = Next<T6>(); }
    public void Make<T1, T2, T3, T4, T5, T6, T7>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5, out T6 v6, out T7 v7) { Make(out v1, out v2, out v3, out v4, out v5, out v6); v7 = Next<T7>(); }
    //public (T1, T2) Make<T1, T2>() { Make(out T1 v1, out T2 v2); return (v1, v2); }
    //public (T1, T2, T3) Make<T1, T2, T3>() { Make(out T1 v1, out T2 v2, out T3 v3); return (v1, v2, v3); }
    //public (T1, T2, T3, T4) Make<T1, T2, T3, T4>() { Make(out T1 v1, out T2 v2, out T3 v3, out T4 v4); return (v1, v2, v3, v4); }
}
public class Pair<T1, T2> : IComparable<Pair<T1, T2>>
{
    public T1 v1;
    public T2 v2;
    public Pair() { }
    public Pair(T1 v1, T2 v2)
    { this.v1 = v1; this.v2 = v2; }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2> p)
    {
        var c = Comparer<T1>.Default.Compare(v1, p.v1);
        if (c == 0)
            c = Comparer<T2>.Default.Compare(v2, p.v2);
        return c;
    }
    public override string ToString() => $"{v1.ToString()} {v2.ToString()}";
    public void Deconstruct(out T1 a, out T2 b) { a = v1; b = v2; }
}

public class Pair<T1, T2, T3> : Pair<T1, T2>, IComparable<Pair<T1, T2, T3>>
{
    public T3 v3;
    public Pair() : base() { }
    public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)
    { this.v3 = v3; }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2, T3> p)
    {
        var c = base.CompareTo(p);
        if (c == 0)
            c = Comparer<T3>.Default.Compare(v3, p.v3);
        return c;
    }
    public override string ToString() => $"{base.ToString()} {v3.ToString()}";
    public void Deconstruct(out T1 a, out T2 b, out T3 c) { Deconstruct(out a, out b); c = v3; }
}
#endregion

#if DEBUG
using System.Reflection;
using System.Threading.Tasks;
#endif

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
using System.Globalization;

#if DEBUG
using System.Diagnostics;
#endif

namespace ed19a
{
    class Program
    {
        static string _inputFilename = "input.txt";
        static string _outputFilename = "output.txt";
        static bool _useFileInput = false;
        const string _delim = "!";

        static void Main(string[] args)
        {
            StreamWriter file = null;
#if DEBUG
            var testNumber = 0;
            var timer = new Stopwatch();
            foreach (var test in GetTests())
            {

                timer.Start();

                var defaultColor = Console.ForegroundColor;
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine($"<!-- TEST #{testNumber} -->");
                Console.ForegroundColor = defaultColor;
                Console.SetIn(test);

#else
            if (_useFileInput)
            {
                Console.SetIn(File.OpenText(_inputFilename));
                file = new StreamWriter(_outputFilename);
                Console.SetOut(file);
            }
#endif

            try
            {
#if DEBUG
                Solution(testNumber);
#else
                Solution(0);
#endif
            }
            finally
            {
#if DEBUG
#else
                if (_useFileInput)
                {
                    file.Close();
                }
#endif
            }

#if DEBUG
                timer.Stop();

                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine($"<!-- TEST #{testNumber} FINISHED IN {timer.Elapsed.ToString(@"ss\:fff")}-->");
                Console.ForegroundColor = defaultColor;

                timer.Reset();
                testNumber++;
            }
#endif
        }

        static void Solution(int testNumber)
        {
            #region SOLUTION
            var d = ReadIntArray();
            var n = d[0];
            var k = d[1];
            var res = new int[k];
            var ri = 0;
            for (int i = 2; i <= Math.Sqrt(n) + 1; i++)
            {
                if (ri == k)
                {
                    break;
                }

                if (n % i != 0)
                {
                    continue;
                }

                while (n % i == 0)
                {
                    if (ri == k)
                    {
                        break;
                        //res[0] *= i;
                    }
                    else
                    {
                        res[ri] = i;
                        ri++;
                    }

                    n /= i;
                }
            }

            if (n != 1)
            {
                if (ri < k)
                {
                    res[ri] = n;
                    ri++;
                }
                else
                {
                    res[0] *= n;
                }
            }

            if (ri != k)
            {
                Console.WriteLine(-1);
            }
            else
            {
                Console.WriteLine(string.Join(" ", res));
            }
            //var n = readInt();
            //var m = readInt();

            //var a = readIntArray();
            //var b = readIntArray();
            #endregion
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int[] ReadIntArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();
        }

        static long[] ReadLongArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();
        }

#if DEBUG
        static IEnumerable<TextReader> GetTests()
        {
            var tests = new List<string>();
            var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];
            using (var resource = new StreamReader(Assembly.GetCallingAssembly().GetManifestResourceStream(resName)))
            {
                while (true)
                {
                    var nextText = new StringBuilder();
                    var endOfFile = false;
                    while (true)
                    {
                        var line = resource.ReadLine();

                        endOfFile = line == null;
                        if (endOfFile)
                        {
                            break;
                        }

                        if (line.Equals(_delim, StringComparison.Ordinal))
                        {
                            break;
                        }

                        nextText.AppendLine(line);
                    }

                    yield return new StringReader(nextText.ToString());

                    if (endOfFile)
                    {
                        break;
                    }
                }
            }
        }
#endif
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Codeforces
{
    class A
    {
      static void Main(string[] args)
      {
          string[] token = Console.ReadLine().Split();

          int n = int.Parse(token[0]);
          int k = int.Parse(token[1]);

          int ans = -1;
          List<int> l = new List<int>();
          int iv =2;
          int nval = n;

          if(k==1)
          {
             Console.WriteLine(n);
             return;
          }

         while(iv<n){
           if(nval%iv==0)
           {
             l.Add(iv);
             nval /= iv;
           }
          else{
            iv++;
           }
           if(l.Count>=k-1)
           {
             if(nval!=1)
              l.Add(nval);
             break;
           }
           }

          if(l.Count<k)
          {
             Console.WriteLine(-1);
          }
          else{
           for(int i=0;i<l.Count;i++)
           {
             Console.Write(l[i] + " ");
            }
          }
      }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace K.Factorization
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
            List<int> primeNumbers = new List<int>();
            var number = input[0];
            var factors = input[1];

            for (int b = 2; number > 1; b++)
            {
                if (number % b == 0)
                {
                    while (number % b == 0)
                    {
                        number /= b;
                        primeNumbers.Add(b);
                    }
                }
            }

            if (primeNumbers.Count() < factors)
            {
                Console.WriteLine(-1);
            }
            else
            {
                StringBuilder message = new StringBuilder();
                for (int i = 0; i < factors - 1; i++)
                {
                    message.Append(primeNumbers[0] + " ");
                    primeNumbers.RemoveAt(0);
                }
                message.Append(primeNumbers.Aggregate(1, (accum, current) => accum * current));
                Console.WriteLine(message.ToString());
            }
        }
    }
}

using System;

namespace CF3
{
    class Program
    {
        public static int SmallDiv(int n)
        {
            int div = 1;
            for (int i = 2; i <= n/2; i++)
                if (n % i == 0)
                {
                    div = i;
                    break;
                }

            return (div == 1) ? n : div;
        }

        static void Main(string[] args)
        {
            string[] a = Console.ReadLine().Split(' ');
            int n = int.Parse(a[0]);
            int k = int.Parse(a[1]);
            string s = "";
            int div;

            for (int i = 0; i < k; i++)
            {
                div = SmallDiv(n);
                if(i < k - 1 && div == n)
                {
                    s = "-1";
                    break;
                }
                s += (i != k - 1) ? div : n;
                s += " ";
                n /= div;
            }
            Console.WriteLine(s);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			//string input2 = Console.ReadLine();
			//string input3 = Console.ReadLine();
			//string input4 = Console.ReadLine();

			var inputs1 = input1.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input4.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

			int n = inputs1[0];
			int k = inputs1[1];

			if (k == 1)
			{
				Console.WriteLine(n);
				return;
			}

			var list = new List<int>();

			int i = 2;
			int copy = n;
			while (i <= Math.Sqrt(n))
			{
				if (copy % i == 0)
				{
					if (list.Count != k - 1)
					{
						copy /= i;
						list.Add(i);
					}
					else
					{
						break;
					}
				}
				else
				{
					i++;
				}
			}

			if (copy > 1)
			{
				list.Add(copy);
			}

			if (list.Count != k)
			{
				Console.WriteLine(-1);
			}
			else
			{
				foreach (var item in list)
				{
					Console.Write($"{item} ");
				}
			}
		}

		public class Node
		{
			public int Count { get; set; }

			public int FirstIndex { get; set; } = -1;

			public int LastIndex { get; set; } = -1;
		}

		//public class Node<T>
		//{
		//	public Node<T> Left { get; set; }

		//	public Node<T> Right { get; set; }

		//	public T Value { get; set; }

		//	public Node(T value)
		//	{
		//		Value = value;
		//	}
		//}

		//public class Tree<T>
		//{
		//	public Node<T> Root { get; set; }

		//	public Tree(T value)
		//	{
		//		Root = new Node<T>(value);
		//	}
		//}

		private static long GCD(long a, long b)
		{
			long max = Math.Max(a, b);
			long min = Math.Min(a, b);

			if (min == 0)
			{
				return max;
			}

			a = min;
			b = max % min;
			return GCD(a, b);
		}

		//private static long LCM(long a, long b)
		//{
		//	return Math.Abs(a * b) / GCD(a, b);
		//}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace k_Factorization
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int n = Next();
            int k = Next();

            var list = new List<int>(k);
            int i = 2;
            while (n > 1 && list.Count < k - 1)
            {
                if (n%i == 0)
                {
                    list.Add(i);
                    n /= i;
                }
                else
                {
                    if (i == 2)
                        i = 3;
                    else i += 2;
                }
            }

            if (n > 1)
                list.Add(n);

            if (list.Count == k)
            {
                foreach (int i1 in list)
                {
                    writer.Write(i1);
                    writer.Write(' ');
                }
            }
            else
            {
                writer.WriteLine("-1");
            }

            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;

namespace _797A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int n = int.Parse(input[0]), k = int.Parse(input[1]);
            List<int> factors = new List<int>();
            for (int div = 2; div <= n; div++)
            {
                while (n % div == 0)
                {
                    factors.Add(div);
                    n /= div;
                }
            }
            if (k > factors.Count)
                Console.WriteLine("-1");
            else
            {
                var newFactors = new int[k];
                for (int i = 0; i < k; i++)
                    newFactors[i] = factors[i];
                for (int i = k; i < factors.Count; i++)
                    newFactors[k - 1] *= factors[i];
                Console.WriteLine(string.Join(" ", newFactors));
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;

namespace CF
{
	internal class Program
	{
		private static void Main(string[] args)
		{
			var sr = new InputReader(Console.In);
			//var sr = new InputReader(new StreamReader("input.txt"));
			var task = new Task();
			using (var sw = Console.Out)
			{
				//using (var sw = new StreamWriter("output.txt")) {
				task.Solve(sr, sw);
				//Console.ReadKey();
			}
		}
	}

	internal class Task
	{
		public void Solve(InputReader sr, TextWriter sw)
		{
			var input = sr.ReadArray(Int32.Parse);
			var n = input[0];
			var k = input[1];
			var factorize = Factorize(n);
			if (factorize.Sum(item => item.Value) < k) {
				sw.WriteLine(-1);
				return;
			}
			var count = 0;
			var result = new List<int>();
			foreach (var item in factorize) {
				for (var i = 0; i < item.Value; i++) {
					if (result.Count == k) {
						result[result.Count - 1] *= item.Key;
					}
					else {
						result.Add(item.Key);
					}
				}
			}

			var sb = new StringBuilder();
			foreach (var item in result) {
				sb.Append(item + " ");
			}

			sw.Write(sb);
		}

		private Dictionary<int, int> Factorize(int n)
		{
			var result = new Dictionary<int, int>();
			var initN = n;
			for (var i = 2; i <= initN; i++)
			{
				if (n % i == 0) {
					var count = 0;
					while (n % i == 0) {
						n /= i;
						count++;
					}
					result.Add(i, count);
				}
			}

			return result;
		}
	}
}

internal class InputReader : IDisposable
{
	private bool isDispose;
	private readonly TextReader sr;

	public InputReader(TextReader stream)
	{
		sr = stream;
	}

	public void Dispose()
	{
		Dispose(true);
		GC.SuppressFinalize(this);
	}

	public string NextString()
	{
		var result = sr.ReadLine();
		return result;
	}

	public int NextInt32()
	{
		return Int32.Parse(NextString());
	}

	public long NextInt64()
	{
		return Int64.Parse(NextString());
	}

	public string[] NextSplitStrings()
	{
		return NextString()
						.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
	}

	public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
	{
		return NextSplitStrings()
						.Select(s => func(s, CultureInfo.InvariantCulture))
						.ToArray();
	}

	public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
	{
		return
						str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
										.Select(s => func(s, CultureInfo.InvariantCulture))
										.ToArray();
	}

	protected void Dispose(bool dispose)
	{
		if (!isDispose)
		{
			if (dispose)
				sr.Close();
			isDispose = true;
		}
	}

	~InputReader()
	{
		Dispose(false);
	}
}

using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = Convert.ToInt32(s[0]);
            int k = Convert.ToInt32(s[1]);
            if(k==1){Console.WriteLine(n);return;}
            List<int> l = new List<int>();
            int t=n;
            for (int i = 2; i < n; )
            {
                if (t % i == 0) {l.Add(i);t/=i;}
                else
                    i++;
            }
            if (l.Count >= k)
            {
                long a = 1;
                for (int i = 0; i < l.Count-k+1; i++)
                {
                    a *= l[i];
                }
                Console.Write(a+" ");
                for (int i = l.Count-k+1; i <l.Count; i++)
                {
                    Console.Write(l[i]+" ");
                }
            }
            else
                Console.WriteLine(-1);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using CompLib.Util;
using System.Threading;

public class Program
{
    public void Solve()
    {
        var sc = new Scanner();
        int n = sc.NextInt();
        int k = sc.NextInt();
        var ls = new List<int>();
        for (int x = 2; x * x <= n; x++)
        {
            while (n % x == 0)
            {
                ls.Add(x);
                n /= x;
            }
        }

        if (n != 1) ls.Add(n);

        if (ls.Count < k)
        {
            Console.WriteLine("-1");
            return;
        }

        int[] ans = new int[k];
        for (int i = 0; i < k; i++)
        {
            ans[i] = ls[i];
        }

        for (int i = k; i < ls.Count; i++)
        {
            ans[0] *= ls[i];
        }

        Console.WriteLine(string.Join(" ", ans));
    }

    public static void Main(string[] args) => new Program().Solve();
    // public static void Main(string[] args) => new Thread(new Program().Solve, 1 << 27).Start();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            if (_index >= _line.Length)
            {
                string s;
                do
                {
                    s = Console.ReadLine();
                } while (s.Length == 0);

                _line = s.Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public string ReadLine()
        {
            _index = _line.Length;
            return Console.ReadLine();
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            string s = Console.ReadLine();
            _line = s.Length == 0 ? new string[0] : s.Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] A = new int[30];
            int pr = 1, j = 2, sz = 1;
            string[] a = Console.ReadLine().Split(' ');
            int n = int.Parse(a[0]);
            int k = int.Parse(a[1]);

            for (int i = 1; i < k && n > 1; i++) {

                while (n % j != 0) {
                    j++;
                }
                n /= j;
                A[sz++] = j;
            }

            if (n > 1)
            {
                A[sz++] = n;
                for (int i = 1; i < sz; i++)
                {
                    Console.Write(A[i]);
                    Console.Write(' ');
                }
            }
            else
            {
                Console.Write(-1);
            }

            //Console.ReadKey();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class PairVariable : IComparable<PairVariable>
{
    public decimal a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = decimal.Parse(q[0]);
        b = decimal.Parse(q[1]);
    }
    public PairVariable(decimal a, decimal b)
    {
        this.a = a;
        this.b = b;
    }

    public int CompareTo(PairVariable other)
    {
        return this.a.CompareTo(other.a);
    }
}

namespace ConsoleApplication254
{

    class Program
    {

        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int n = int.Parse(ss[0]);
            int m = int.Parse(ss[1]);
            bool[] p = new bool[n + 1];
            for (int i = 2; i <= n; i++)
            {
                if (!p[i])
                {
                    for (int e = i + i; e <= n; e+=i)
                    {
                        p[e] = true;
                    }
                }
            }
            int k = 0;
            for (int i = 0; i < p.Length; i++)
            {
                if (!p[i])
                {
                    k++;
                }
            }
            int[] arr = new int[k];
            k = 0;
            for (int i = 2; i < p.Length; i++)
            {
                if (!p[i])
                {
                    arr[k] = i;
                    k++;
                }
            }
            List<int> r = new List<int>();
            while (n != 1)
            {

                int t = 0;
                for (int i = 0; i < arr.Length; i++)
                {
                    if (n % arr[i] == 0)
                    {
                        t = arr[i];
                        break;
                    }
                }
                r.Add(t);
                n /= t;
            }
            /*for (int i = 0; i < r.Count; i++)
            {
                Console.WriteLine(r[i]);
            }*/
            if (m > r.Count)
            {
                Console.WriteLine(-1);

            }
            else
            {
              //  Console.WriteLine(r.Count);
                int ans = 1;
                for (int i = 0; i < m-1; i++)
                {
                    Console.Write(r[i]+" ");
                }
                for (int i = m-1; i < r.Count; i++)
                {
                    ans *= r[i];
                }
                Console.WriteLine(ans);
            }

        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace ConsoleApplication1
{
	class Program
	{
		public const long MOD = 1000000007;

		static void Main(string[] args)
		{
			try
			{
				Main main = new Main();
				main.ReadData();
				main.Process();
				main.WriteAnswer();
			}
			catch (Exception e)
			{
				Console.WriteLine(e);
			}
		}
	}

	class Main
	{
		private int _n;
		private int _k;

		private List<int> _result = new List<int>();

		public void Process()
		{
			List<int> dividers = new List<int>();
			int n = _n;
			for (int i = 2; i <= _n; i++)
			{
				while (n % i == 0)
				{
					dividers.Add(i);
					n = n / i;
				}
			}
			if (dividers.Count >= _k)
			{
				for (int i = 0; i < _k -1; i++)
				{
					_result.Add(dividers[i]);
				}
				int prod = 1;
				for (int i = _k-1; i < dividers.Count; i++)
				{
					prod *= dividers[i];
				}
				_result.Add(prod);
			}
		}

		private long Nok(long x, long y)
		{
			return x*y/Nod(x, y);
		}
		private long Nod(long x, long y)
		{
			long max = Math.Max(x, y);
			long min = Math.Min(x, y);

			while (true)
			{
				long rem = max % min;
				if (rem == 0)
				{
					return min;
				}
				max = min;
				min = rem;
			}
		}

		public void ReadData()
		{
#if DEVELOPMENT
			TextReader textReader = new StreamReader("input.txt");
#else
			TextReader textReader = Console.In;
#endif
			using (TextReader reader = textReader)
			{
				string readLine = reader.ReadLine();
				string[] strings = readLine.Split(' ');
				_n = int.Parse(strings[0]);
				_k = int.Parse(strings[1]);
			}
		}

		public void WriteAnswer()
		{
			using (TextWriter writer = Console.Out)
			{
				if (_result.Count == 0)
				{
					writer.WriteLine(-1);
				}
				else
				{
					writer.WriteLine(string.Join(" ", _result));
				}
			}
		}
	}

	internal class Position
	{
		public int Row { get; set; }
		public int Place { get; set; }
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data;
using System.Diagnostics;

namespace testing
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split();
            int a = int.Parse(input[0]);
            int b = int.Parse(input[1]);
            int j = 0;
            int k = 2;
            string ans = "";
            while (a > 1 && j < b - 1)
            {
                if (a % k == 0)
                {
                    a /= k;
                    j++;
                    ans += k + " ";
                }
                else
                {
                    if (k == 2)
                    {
                        k = 3;
                    }
                    else
                    {
                        k += 2;
                    }
                }
            }
            if (a == 1)
            {
                ans = "-1";
            }
            else
            {
                ans += a;
            }
            Console.WriteLine(ans);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp26
{
    class Program
    {
        static void Main(string[] args)
        {

            int[] inp0 = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int k = inp0[0];
            int n = inp0[1];
            List<int> l = new List<int>();
            for (int i = 0; i < n-1; i++)
            {
                for (int j = 2; j <= Math.Sqrt(k); j++)
                {
                    if (k%j==0)
                    {
                        k /= j;
                        l.Add(j);
                        break;
                    }
                }
            }
            if (l.Count < n - 1)
            {
                Console.WriteLine(-1);
            }
            else
            {
                foreach (int item in l)
                {
                    Console.Write(item + " ");

                }
                Console.Write(k);
            }
        }

    }

}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace K_Factorization
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int orign = int.Parse(input[0]), k = int.Parse(input[1]);
            int n = orign;
            int sum = 0, index = 2, mult = 1;
            string answer = "";
            while (sum + 1 < k && index <= Math.Sqrt(n))
            {
                if (n % index == 0 && IsPrime(index))
                {
                    while (n % index == 0 && sum + 1 < k)
                    {
                        answer += index + " ";
                        n /= index;
                        sum++;
                        mult *= index;
                    }
                }
                index++;
            }
            if (sum + 1 < k || mult == orign)
            {
                Console.WriteLine("-1");
                return;
            }
            answer += orign / mult;
            Console.WriteLine(answer);
        }
        static bool IsPrime(int x)
        {
            for (int i = 2; i <= Math.Sqrt(x); i++)
                if (x % i == 0)
                    return false;
            return true;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace ConsoleApplication4
{
    class Program
    {
        static int[] readArray()
        {
            string[] s = Console.ReadLine().Split(' ');
            int len = s.Length;
            int[] data = new int[len];
            for (int i = 0; i < len; i++)
            {
                data[i] = int.Parse(s[i]);
            }
            return data;
        }
        static int readInt()
        {
            string s = Console.ReadLine();
            return int.Parse(s);
        }

        static void Main(string[] args)
        {
            int[] nk = readArray();
            int n = nk[0];
            int k = nk[1];

            List<int> answer = new List<int>();

            for(int i = 1; i < k; i++)
            {
                for(int j = 2; j * j <= n; j++)
                {
                    if (n % j == 0)
                    {
                        answer.Add(j);
                        n /= j;
                        break;
                    }
                }
            }

            if (n > 1)
            {
                answer.Add(n);
            }

            if (answer.Count == k)
            {
                foreach(int t in answer)
                {
                    Console.Write(t + " ");
                }
            }else
            {
                Console.Write(-1);
            }

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace K.Factorization
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
            List<int> primeNumbers = new List<int>();
            var number = input[0];
            var factors = input[1];

            for (int b = 2; number > 1; b++)
            {
                if (number % b == 0)
                {
                    while (number % b == 0)
                    {
                        number /= b;
                        primeNumbers.Add(b);
                    }
                }
            }

            if (primeNumbers.Count() < factors)
                Console.WriteLine(-1);
            else
            {
                StringBuilder message = new StringBuilder();
                for (int i = 0; i < factors - 1; i++)
                {
                    message.Append(primeNumbers[0] + " ");
                    primeNumbers.RemoveAt(0);
                }
                message.Append(primeNumbers.Aggregate(1, (accum, current) => accum * current));
                Console.WriteLine(message.ToString());
            }
        }
    }
}

using System;
using System.Collections.Generic;

namespace CSharp
{
    class _797A
    {
        public static void Main()
        {
            var tokens = Console.ReadLine().Split();

            int n = int.Parse(tokens[0]);
            int k = int.Parse(tokens[1]);

            var divisors = new LinkedList<int>();

            for (int i = 2; i <= n; i++)
            {
                while (n % i == 0)
                {
                    divisors.AddLast(i);
                    n /= i;
                }
            }

            while (divisors.Count > k)
            {
                int first = divisors.First.Value;
                divisors.RemoveFirst();

                int second = divisors.First.Value;
                divisors.RemoveFirst();

                divisors.AddFirst(first * second);
            }

            Console.WriteLine(divisors.Count < k ? "-1" : string.Join(" ", divisors));
        }
    }
}

#if DEBUG
using System.Reflection;
using System.Threading.Tasks;
#endif

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Numerics;
using System.Globalization;

#if DEBUG
using System.Diagnostics;
#endif

namespace ed19a
{
    class Program
    {
        static string _inputFilename = "input.txt";
        static string _outputFilename = "output.txt";
        static bool _useFileInput = false;
        const string _delim = "!";

        static void Main(string[] args)
        {
            StreamWriter file = null;
#if DEBUG
            var testNumber = 0;
            var timer = new Stopwatch();
            foreach (var test in GetTests())
            {

                timer.Start();

                var defaultColor = Console.ForegroundColor;
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine($"<!-- TEST #{testNumber} -->");
                Console.ForegroundColor = defaultColor;
                Console.SetIn(test);

#else
            if (_useFileInput)
            {
                Console.SetIn(File.OpenText(_inputFilename));
                file = new StreamWriter(_outputFilename);
                Console.SetOut(file);
            }
#endif

            try
            {
#if DEBUG
                Solution(testNumber);
#else
                Solution(0);
#endif
            }
            finally
            {
#if DEBUG
#else
                if (_useFileInput)
                {
                    file.Close();
                }
#endif
            }

#if DEBUG
                timer.Stop();

                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine($"<!-- TEST #{testNumber} FINISHED IN {timer.Elapsed.ToString(@"ss\:fff")}-->");
                Console.ForegroundColor = defaultColor;

                timer.Reset();
                testNumber++;
            }
#endif
        }

        static void Solution(int testNumber)
        {
            #region SOLUTION
            var d = ReadIntArray();
            var n = d[0];
            var k = d[1];
            var res = new int[k];
            var ri = 0;
            for (int i = 2; i <= Math.Sqrt(n) + 1; i++)
            {
                if (ri == k)
                {
                    break;
                }

                if (n % i != 0)
                {
                    continue;
                }

                while (n % i == 0)
                {
                    if (ri == k)
                    {
                        break;
                        //res[0] *= i;
                    }
                    else
                    {
                        res[ri] = i;
                        ri++;
                    }

                    n /= i;
                }
            }

            if (n != 1)
            {
                res[0] *= n;
            }

            if (ri != k)
            {
                Console.WriteLine(-1);
            }
            else
            {
                Console.WriteLine(string.Join(" ", res));
            }
            //var n = readInt();
            //var m = readInt();

            //var a = readIntArray();
            //var b = readIntArray();
            #endregion
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int[] ReadIntArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();
        }

        static long[] ReadLongArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();
        }

#if DEBUG
        static IEnumerable<TextReader> GetTests()
        {
            var tests = new List<string>();
            var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];
            using (var resource = new StreamReader(Assembly.GetCallingAssembly().GetManifestResourceStream(resName)))
            {
                while (true)
                {
                    var nextText = new StringBuilder();
                    var endOfFile = false;
                    while (true)
                    {
                        var line = resource.ReadLine();

                        endOfFile = line == null;
                        if (endOfFile)
                        {
                            break;
                        }

                        if (line.Equals(_delim, StringComparison.Ordinal))
                        {
                            break;
                        }

                        nextText.AppendLine(line);
                    }

                    yield return new StringReader(nextText.ToString());

                    if (endOfFile)
                    {
                        break;
                    }
                }
            }
        }
#endif
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Codeforces
{
    class A
    {
      static void Main(string[] args)
      {
          string[] token = Console.ReadLine().Split();

          int n = int.Parse(token[0]);
          int k = int.Parse(token[1]);

          int ans = -1;
          List<int> l = new List<int>();
          int iv =2;
          int nval = n;

         while(iv<n){
           if(nval%iv==0)
           {
             l.Add(iv);
             nval /= iv;
           }
          else{
            iv++;
           }
           if(l.Count>=k-1)
           {
             if(nval!=1)
              l.Add(nval);
             break;
           }
           }

          if(l.Count<k)
          {
             Console.WriteLine(-1);
          }
          else{
           for(int i=0;i<l.Count;i++)
           {
             Console.Write(l[i] + " ");
            }
          }
      }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			//string input2 = Console.ReadLine();
			//string input3 = Console.ReadLine();
			//string input4 = Console.ReadLine();

			var inputs1 = input1.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input4.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

			int n = inputs1[0];
			int k = inputs1[1];
			var list = new List<int>();

			int i = 2;
			while (i <= Math.Sqrt(n))
			{
				if (n % i == 0)
				{
					if (list.Count != k - 1)
					{
						n /= i;
						list.Add(i);
					}
					else
					{
						list.Add(n);
						break;
					}
				}
				else
				{
					i++;
				}
			}

			if (list.Count != k)
			{
				Console.WriteLine(-1);
			}
			else
			{
				foreach (var item in list)
				{
					Console.Write($"{item} ");
				}
			}
		}

		public class Node
		{
			public int Count { get; set; }

			public int FirstIndex { get; set; } = -1;

			public int LastIndex { get; set; } = -1;
		}

		//public class Node<T>
		//{
		//	public Node<T> Left { get; set; }

		//	public Node<T> Right { get; set; }

		//	public T Value { get; set; }

		//	public Node(T value)
		//	{
		//		Value = value;
		//	}
		//}

		//public class Tree<T>
		//{
		//	public Node<T> Root { get; set; }

		//	public Tree(T value)
		//	{
		//		Root = new Node<T>(value);
		//	}
		//}

		private static long GCD(long a, long b)
		{
			long max = Math.Max(a, b);
			long min = Math.Min(a, b);

			if (min == 0)
			{
				return max;
			}

			a = min;
			b = max % min;
			return GCD(a, b);
		}

		//private static long LCM(long a, long b)
		//{
		//	return Math.Abs(a * b) / GCD(a, b);
		//}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			//string input2 = Console.ReadLine();
			//string input3 = Console.ReadLine();
			//string input4 = Console.ReadLine();

			var inputs1 = input1.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input4.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

			int n = inputs1[0];
			int k = inputs1[1];
			var list = new List<int>();

			int i = 2;
			int copy = n;
			while (i <= Math.Sqrt(n))
			{
				if (copy % i == 0)
				{
					if (list.Count != k - 1)
					{
						copy /= i;
						list.Add(i);
					}
					else
					{
						list.Add(copy);
						break;
					}
				}
				else
				{
					i++;
				}
			}

			if (list.Count != k)
			{
				Console.WriteLine(-1);
			}
			else
			{
				foreach (var item in list)
				{
					Console.Write($"{item} ");
				}
			}
		}

		public class Node
		{
			public int Count { get; set; }

			public int FirstIndex { get; set; } = -1;

			public int LastIndex { get; set; } = -1;
		}

		//public class Node<T>
		//{
		//	public Node<T> Left { get; set; }

		//	public Node<T> Right { get; set; }

		//	public T Value { get; set; }

		//	public Node(T value)
		//	{
		//		Value = value;
		//	}
		//}

		//public class Tree<T>
		//{
		//	public Node<T> Root { get; set; }

		//	public Tree(T value)
		//	{
		//		Root = new Node<T>(value);
		//	}
		//}

		private static long GCD(long a, long b)
		{
			long max = Math.Max(a, b);
			long min = Math.Min(a, b);

			if (min == 0)
			{
				return max;
			}

			a = min;
			b = max % min;
			return GCD(a, b);
		}

		//private static long LCM(long a, long b)
		//{
		//	return Math.Abs(a * b) / GCD(a, b);
		//}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			//string input2 = Console.ReadLine();
			//string input3 = Console.ReadLine();
			//string input4 = Console.ReadLine();

			var inputs1 = input1.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input4.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

			int n = inputs1[0];
			int k = inputs1[1];

			if (k == 1)
			{
				Console.WriteLine(n);
				return;
			}

			var list = new List<int>();

			int i = 2;
			int copy = n;
			while (i <= Math.Sqrt(n))
			{
				if (copy % i == 0)
				{
					if (list.Count != k - 1)
					{
						copy /= i;
						list.Add(i);
					}
					else
					{
						list.Add(copy);
						break;
					}
				}
				else
				{
					i++;
				}
			}

			if (list.Count != k)
			{
				Console.WriteLine(-1);
			}
			else
			{
				foreach (var item in list)
				{
					Console.Write($"{item} ");
				}
			}
		}

		public class Node
		{
			public int Count { get; set; }

			public int FirstIndex { get; set; } = -1;

			public int LastIndex { get; set; } = -1;
		}

		//public class Node<T>
		//{
		//	public Node<T> Left { get; set; }

		//	public Node<T> Right { get; set; }

		//	public T Value { get; set; }

		//	public Node(T value)
		//	{
		//		Value = value;
		//	}
		//}

		//public class Tree<T>
		//{
		//	public Node<T> Root { get; set; }

		//	public Tree(T value)
		//	{
		//		Root = new Node<T>(value);
		//	}
		//}

		private static long GCD(long a, long b)
		{
			long max = Math.Max(a, b);
			long min = Math.Min(a, b);

			if (min == 0)
			{
				return max;
			}

			a = min;
			b = max % min;
			return GCD(a, b);
		}

		//private static long LCM(long a, long b)
		//{
		//	return Math.Abs(a * b) / GCD(a, b);
		//}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			//string input2 = Console.ReadLine();
			//string input3 = Console.ReadLine();
			//string input4 = Console.ReadLine();

			var inputs1 = input1.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input4.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

			int n = inputs1[0];
			int k = inputs1[1];

			if (k == 1)
			{
				Console.WriteLine(n);
				return;
			}

			var list = new List<int>();

			int i = 2;
			int copy = n;
			while (i <= Math.Sqrt(n))
			{
				if (copy % i == 0)
				{
					if (list.Count != k - 1)
					{
						copy /= i;
						list.Add(i);
					}
					else
					{
						break;
					}
				}
				else
				{
					i++;
				}
			}
			list.Add(copy);

			if (list.Count != k)
			{
				Console.WriteLine(-1);
			}
			else
			{
				foreach (var item in list)
				{
					Console.Write($"{item} ");
				}
			}
		}

		public class Node
		{
			public int Count { get; set; }

			public int FirstIndex { get; set; } = -1;

			public int LastIndex { get; set; } = -1;
		}

		//public class Node<T>
		//{
		//	public Node<T> Left { get; set; }

		//	public Node<T> Right { get; set; }

		//	public T Value { get; set; }

		//	public Node(T value)
		//	{
		//		Value = value;
		//	}
		//}

		//public class Tree<T>
		//{
		//	public Node<T> Root { get; set; }

		//	public Tree(T value)
		//	{
		//		Root = new Node<T>(value);
		//	}
		//}

		private static long GCD(long a, long b)
		{
			long max = Math.Max(a, b);
			long min = Math.Min(a, b);

			if (min == 0)
			{
				return max;
			}

			a = min;
			b = max % min;
			return GCD(a, b);
		}

		//private static long LCM(long a, long b)
		//{
		//	return Math.Abs(a * b) / GCD(a, b);
		//}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input1 = Console.ReadLine();
			//string input2 = Console.ReadLine();
			//string input3 = Console.ReadLine();
			//string input4 = Console.ReadLine();

			var inputs1 = input1.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
			//var inputs2 = input4.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

			int n = inputs1[0];
			int k = inputs1[1];

			if (k == 1)
			{
				Console.WriteLine(n);
				return;
			}

			var list = new List<int>();

			int i = 2;
			int copy = n;
			while (i <= Math.Sqrt(n))
			{
				if (copy % i == 0)
				{
					if (list.Count != k - 1)
					{
						copy /= i;
						list.Add(i);
					}
					else
					{
						list.Add(copy);
						break;
					}
				}
				else
				{
					i++;
				}
			}
			list.Add(copy);

			if (list.Count != k)
			{
				Console.WriteLine(-1);
			}
			else
			{
				foreach (var item in list)
				{
					Console.Write($"{item} ");
				}
			}
		}

		public class Node
		{
			public int Count { get; set; }

			public int FirstIndex { get; set; } = -1;

			public int LastIndex { get; set; } = -1;
		}

		//public class Node<T>
		//{
		//	public Node<T> Left { get; set; }

		//	public Node<T> Right { get; set; }

		//	public T Value { get; set; }

		//	public Node(T value)
		//	{
		//		Value = value;
		//	}
		//}

		//public class Tree<T>
		//{
		//	public Node<T> Root { get; set; }

		//	public Tree(T value)
		//	{
		//		Root = new Node<T>(value);
		//	}
		//}

		private static long GCD(long a, long b)
		{
			long max = Math.Max(a, b);
			long min = Math.Min(a, b);

			if (min == 0)
			{
				return max;
			}

			a = min;
			b = max % min;
			return GCD(a, b);
		}

		//private static long LCM(long a, long b)
		//{
		//	return Math.Abs(a * b) / GCD(a, b);
		//}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using CompLib.Util;
using System.Threading;

public class Program
{
    public void Solve()
    {
        var sc = new Scanner();
        int n = sc.NextInt();
        int k = sc.NextInt();
        var ls = new List<int>();
        for (int x = 2; x * x <= n; x++)
        {
            while (n % x == 0)
            {
                ls.Add(x);
                n /= x;
            }
        }

        if (ls.Count < k)
        {
            Console.WriteLine("-1");
            return;
        }

        int[] ans = new int[k];
        for (int i = 0; i < k; i++)
        {
            ans[i] = ls[i];
        }

        for (int i = k; i < ls.Count; i++)
        {
            ans[0] *= ls[i];
        }

        Console.WriteLine(string.Join(" ", ans));
    }

    public static void Main(string[] args) => new Program().Solve();
    // public static void Main(string[] args) => new Thread(new Program().Solve, 1 << 27).Start();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            if (_index >= _line.Length)
            {
                string s;
                do
                {
                    s = Console.ReadLine();
                } while (s.Length == 0);

                _line = s.Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public string ReadLine()
        {
            _index = _line.Length;
            return Console.ReadLine();
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            string s = Console.ReadLine();
            _line = s.Length == 0 ? new string[0] : s.Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Kfactorization
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();

            int n = int.Parse(s[0]);
            int k = int.Parse(s[1]);

            List<int> factors = new List<int>();

            int p = 2;

            while (n>1)
            {
                if (n%p==0)
                {
                    factors.Add(p);
                    n /= p;
                    if (factors.Count == k - 1) break;
                }
                else
                {
                    p++;
                }
            }

            if (n > 1) factors.Add(n);

            if (factors.Count==k)
            {
                foreach (var factor in factors)
                {
                    Console.Write("{0} ", factor);
                }
            }
            else
            {
                Console.Write(-1);
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;

namespace CF
{
	internal class Program
	{
		private static void Main(string[] args)
		{
			var sr = new InputReader(Console.In);
			//var sr = new InputReader(new StreamReader("input.txt"));
			var task = new Task();
			using (var sw = Console.Out)
			{
				//using (var sw = new StreamWriter("output.txt")) {
				task.Solve(sr, sw);
				//Console.ReadKey();
			}
		}
	}

	internal class Task
	{
		public void Solve(InputReader sr, TextWriter sw)
		{
			var input = sr.ReadArray(Int32.Parse);
			var n = input[0];
			var k = input[1];
			var factorize = Factorize(n);
			if (factorize.Count == 0) {
				sw.WriteLine(-1);
				return;
			}
			if (factorize.Sum(item => item.Value) < k) {
				sw.WriteLine(-1);
				return;
			}
			var count = 0;
			var result = new List<int>();
			foreach (var item in factorize) {
				for (var i = 0; i < item.Value; i++) {
					if (result.Count == k) {
						result[result.Count - 1] *= item.Key;
					}
					else {
						result.Add(item.Key);
					}
				}
			}

			var sb = new StringBuilder();
			foreach (var item in result) {
				sb.Append(item + " ");
			}

			sw.Write(sb);
		}

		private Dictionary<int, int> Factorize(int n)
		{
			var result = new Dictionary<int, int>();
			var initN = n;
			for (var i = 2; i < initN; i++)
			{
				if (n % i == 0) {
					var count = 0;
					while (n % i == 0) {
						n /= i;
						count++;
					}
					result.Add(i, count);
				}
			}

			return result;
		}
	}
}

internal class InputReader : IDisposable
{
	private bool isDispose;
	private readonly TextReader sr;

	public InputReader(TextReader stream)
	{
		sr = stream;
	}

	public void Dispose()
	{
		Dispose(true);
		GC.SuppressFinalize(this);
	}

	public string NextString()
	{
		var result = sr.ReadLine();
		return result;
	}

	public int NextInt32()
	{
		return Int32.Parse(NextString());
	}

	public long NextInt64()
	{
		return Int64.Parse(NextString());
	}

	public string[] NextSplitStrings()
	{
		return NextString()
						.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
	}

	public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
	{
		return NextSplitStrings()
						.Select(s => func(s, CultureInfo.InvariantCulture))
						.ToArray();
	}

	public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
	{
		return
						str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
										.Select(s => func(s, CultureInfo.InvariantCulture))
										.ToArray();
	}

	protected void Dispose(bool dispose)
	{
		if (!isDispose)
		{
			if (dispose)
				sr.Close();
			isDispose = true;
		}
	}

	~InputReader()
	{
		Dispose(false);
	}
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;

namespace CF
{
	internal class Program
	{
		private static void Main(string[] args)
		{
			var sr = new InputReader(Console.In);
			//var sr = new InputReader(new StreamReader("input.txt"));
			var task = new Task();
			using (var sw = Console.Out)
			{
				//using (var sw = new StreamWriter("output.txt")) {
				task.Solve(sr, sw);
				//Console.ReadKey();
			}
		}
	}

	internal class Task
	{
		public void Solve(InputReader sr, TextWriter sw)
		{
			var input = sr.ReadArray(Int32.Parse);
			var n = input[0];
			var k = input[1];
			var factorize = Factorize(n);
			if (factorize.Count == 0) {
				sw.WriteLine(-1);
				return;
			}
			if (factorize.Sum(item => item.Value) < k) {
				sw.WriteLine(-1);
				return;
			}
			var count = 0;
			var result = new List<int>();
			foreach (var item in factorize) {
				for (var i = 0; i < item.Value; i++) {
					if (result.Count == k) {
						result[result.Count - 1] *= item.Key;
					}
					else {
						result.Add(item.Key);
					}
				}
			}

			var sb = new StringBuilder();
			foreach (var item in result) {
				sb.Append(item + " ");
			}

			sw.Write(sb);
		}

		private Dictionary<int, int> Factorize(int n)
		{
			var mid = (int) Math.Sqrt(n);
			var result = new Dictionary<int, int>();
			for (var i = 2; i <= mid; i++) {
				if (n % i == 0) {
					var count = 0;
					while (n % i == 0) {
						n /= i;
						count++;
					}
					result.Add(i, count);
				}
			}

			return result;
		}
	}
}

internal class InputReader : IDisposable
{
	private bool isDispose;
	private readonly TextReader sr;

	public InputReader(TextReader stream)
	{
		sr = stream;
	}

	public void Dispose()
	{
		Dispose(true);
		GC.SuppressFinalize(this);
	}

	public string NextString()
	{
		var result = sr.ReadLine();
		return result;
	}

	public int NextInt32()
	{
		return Int32.Parse(NextString());
	}

	public long NextInt64()
	{
		return Int64.Parse(NextString());
	}

	public string[] NextSplitStrings()
	{
		return NextString()
						.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
	}

	public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
	{
		return NextSplitStrings()
						.Select(s => func(s, CultureInfo.InvariantCulture))
						.ToArray();
	}

	public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
	{
		return
						str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
										.Select(s => func(s, CultureInfo.InvariantCulture))
										.ToArray();
	}

	protected void Dispose(bool dispose)
	{
		if (!isDispose)
		{
			if (dispose)
				sr.Close();
			isDispose = true;
		}
	}

	~InputReader()
	{
		Dispose(false);
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] A = new int[30];
            int pr = 1, j = 2, sz = 1;
            string[] a = Console.ReadLine().Split(' ');
            int n = int.Parse(a[0]);
            int k = int.Parse(a[1]);

            for (int i = 1; i < k; i++) {

                while (n % j != 0) {
                    j++;
                }

                pr *= j;
                A[sz++] = j;
            }

            if (n / pr > 1)
            {
                A[sz++] = n / pr;
                for (int i = 1; i < sz; i++)
                {
                    Console.Write(A[i]);
                    Console.Write(' ');
                }
            }
            else
            {
                Console.Write(-1);
            }

            //Console.ReadKey();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class PairVariable : IComparable<PairVariable>
{
    public int a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = int.Parse(q[0]);
        b = int.Parse(q[1]);
    }
    public PairVariable(int a, int b)
    {
        this.a = a;
        this.b = b;
    }
    public int CompareTo(PairVariable pv)
    {
        if (this.a > pv.a)
        {
            return 1;
        }
        else if (this.a < pv.a)
        {
            return -1;
        }
        else
        {
            if (this.b >= pv.b)
            {
                return 1;
            }
            else
            {
                return -1;
            }
        }
    }

}
namespace ConsoleApplication254
{
    class Program
    {

        static int sum = 1;
        static Dictionary<int, List<int>> d = new Dictionary<int, List<int>>();
        static int k = 0;
        static string ans = "";
        static void dfs(int v)
        {

        }
        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            ulong n = ulong.Parse(ss[0]);
            k = int.Parse(ss[1]);
            ulong del = 0;
            if (k == 1)
            {
                Console.WriteLine(n);
                return;
            }
            for (ulong i = 2; i <= n; i++)
            {
                if (n % i == 0)
                {
                    del = i;
                    break;
                }
            }
            ulong c = 0;
            bool ans = false;
            ulong f = (ulong)(Math.Pow(del, (k - 1)));

            for (ulong i = 2; i <= n; i++)
            {
                if (f * i == n)
                {
                    c = i;
                    ans = true;
                    break;
                }
            }
            if (!ans)
            {
                Console.WriteLine(-1);
                return;
            }
            for (int i = 0; i < k-1; i++)
            {
                Console.Write(del+" ");
            }
            Console.WriteLine(c);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class PairVariable : IComparable<PairVariable>
{
    public int a, b;
    public PairVariable()
    {
        a = b = 0;
    }
    public PairVariable(string s)
    {
        string[] q = s.Split();
        a = int.Parse(q[0]);
        b = int.Parse(q[1]);
    }
    public PairVariable(int a, int b)
    {
        this.a = a;
        this.b = b;
    }
    public int CompareTo(PairVariable pv)
    {
        if (this.a > pv.a)
        {
            return 1;
        }
        else if (this.a < pv.a)
        {
            return -1;
        }
        else
        {
            if (this.b >= pv.b)
            {
                return 1;
            }
            else
            {
                return -1;
            }
        }
    }

}
namespace ConsoleApplication254
{
    class Program
    {

        static int sum = 1;
        static Dictionary<int, List<int>> d = new Dictionary<int, List<int>>();
        static int k = 0;
        static string ans = "";
        static void dfs(int v)
        {

        }
        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int n = int.Parse(ss[0]);
            k = int.Parse(ss[1]);
            int del = 0;
            if (k == 1)
            {
                Console.WriteLine(n);
                return;
            }
            for (int i = 2; i <= n; i++)
            {
                if (n % i == 0)
                {
                    del = i;
                    break;
                }
            }
            int c = 0;
            bool ans = false;
            int f = (int)(Math.Pow(del, (k - 1)));

            for (int i = 2; i <= n; i++)
            {
                if (f * i == n)
                {
                    c = i;
                    ans = true;
                    break;
                }
            }
            if (!ans)
            {
                Console.WriteLine(-1);
                return;
            }
            for (int i = 0; i < k-1; i++)
            {
                Console.Write(del+" ");
            }
            Console.WriteLine(c);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data;
using System.Diagnostics;

namespace testing
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split();
            int a = int.Parse(input[0]);
            int b = int.Parse(input[1]);
            int j = 0;
            string ans = "";
            for (int i=0; i<b-1; i++)
            {
                if (a % 2 == 0)
                {
                    a /= 2;
                    j++;
                    ans += "2 ";
                }
                else if (a % 3 == 0)
                {
                    a /= 3;
                    j++;
                    ans += "3 ";
                }
                else if (a % 5 == 0)
                {
                    a /= 5;
                    j++;
                    ans += "5 ";
                }
                else if (a % 7 == 0)
                {
                    a /= 7;
                    j++;
                    ans += "7 ";
                }
                else
                {
                    ans = "-1";
                    break;
                }
            }
            if(ans != "-1")
            {
                ans += a;
            }

            Console.WriteLine(ans);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace K_Factorization
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int orign = int.Parse(input[0]), k = int.Parse(input[1]);
            int n = orign;
            int sum = 0, index = 2, mult = 1;
            string answer = "";
            while (sum + 1 < k && index <= Math.Sqrt(n))
            {
                if (n % index == 0 && IsPrime(index))
                {
                    while (n % index == 0 && sum + 1 < k)
                    {
                        answer += index + " ";
                        n /= index;
                        sum++;
                        mult *= index;
                    }
                }
                index++;
            }
            if (sum + 1 < k)
            {
                Console.WriteLine("-1");
                return;
            }
            answer += orign / mult;
            Console.WriteLine(answer);
        }
        static bool IsPrime(int x)
        {
            for (int i = 2; i <= Math.Sqrt(x); i++)
                if (x % i == 0)
                    return false;
            return true;
        }
    }
}