import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;


public class ANARC_2010_E_alt
{
	BufferedReader in;
	Scanner inr;
	PrintWriter out;

	void initIO() throws IOException
	{
		inr = new Scanner(System.in);
		in = new BufferedReader(new InputStreamReader(
				System.in));
		out = new PrintWriter(new OutputStreamWriter(System.out));
	}
	
	void solve() throws Exception
	{
		int nt = 0;
		while (true)
		{
			long G = nextInt();
			if (G < 0)
				break;
			long T = nextInt();
			long A = nextInt();
			long D = nextInt();
			long teams = G * A + D;
			long pow2 = 1;
			while (teams > pow2) pow2 *= 2;
			long games = G * (T * (T - 1)) / 2;
			games += pow2 - 1;
			//out.println("p2 = " + pow2);
			out.println(G + "*" + A + "/" + T + "+" + D + "=" + games+ "+" + (pow2 - teams));
			out.flush();
		}
	}

	void run() throws Exception
	{
		initIO();
		solve();
		out.flush();
	}

	int nextInt()
	{
		return inr.nextInt();
	}
	
	String nextLine()
	{
		return inr.nextLine();
	}
	
	String nextString()
	{
		return inr.next();
	}

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