// Arup Guha
// 10/28/2015
// Alternate solution to 2012 SE Regional Problem (both D1, D2): Do It Wrong, Get It Right

import java.util.*;

public class doitwrong {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		long b = stdin.nextLong();
		long n = stdin.nextLong();

		while (b != 0 || n != 0) {

			boolean printed = false;

			// We solve for a and get a = bm(2n-m)/(n*n). So, m is in [1, 2n].
			// To get the order they want, go backwards.
			for (long m=2*n; m>=1; m--) {

				// Not supposed to print the same thing.
				if (m == n) continue;

				// The denominator needs to divide evenly into the numerator.
				if ((b*m*(2*n-m))%(n*n) == 0) {
					long a = (b*m*(2*n-m))/(n*n);
					if (printed) System.out.print(" ");
					System.out.print(a+"/"+m);
					printed = true;
				}
			}
			System.out.println();

			// Go to next case.
			b = stdin.nextLong();
			n = stdin.nextLong();
		}
	}
}