// Arup Guha
// 9/21/2013
// Solution to 2010 Arab Programming Contest Problem E: Sometimes, a penalty is good!
import java.util.*;

public class e {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);

		// This is annoying because 2^16 * 2^16 = 2^32 overflows int...
		long groups = stdin.nextLong();
		long teams = stdin.nextLong();
		long adv = stdin.nextLong();
		long direct = stdin.nextLong();

		while (groups != -1) {

			// Calculate # teams in playoffs and games before playoffs.
			// Watch out for the order for games calculation.
			long playoffs = groups*adv + direct;
			long games = teams*(teams-1)/2*groups;

			// Figure out how many teams to add.
			long extra = getExtra(playoffs);
			playoffs += extra;

			// In any knockout tournament with n teams, n-1 games are played.
			// All but the champion lost exactly one game.
			games += (playoffs-1);

			System.out.println(groups+"*"+adv+"/"+teams+"+"+direct+"="+games+"+"+extra);

			// Get next case.
			groups = stdin.nextLong();
			teams = stdin.nextLong();
			adv = stdin.nextLong();
			direct = stdin.nextLong();
		}
	}

	// Returns how much to add (non-neg int) to n to total a power of 2.
	public static long getExtra(long n) {

		// Bit shift to the answer and return the difference.
		long total = 1L;
		while (total < n) total = total << 1;
		return total-n;
	}
}