class Monome
{
	protected int coef;
	protected int exp;
	
	public Monome(int coef, int exp)
	{
		this.coef = coef;
		this.exp = exp;
	}
	
	public int getCoef()
	{
		return coef;
	}
	
	public int getExp()
	{
		return exp;
	}
	
	public String toString()
	{
		String resultat = "";
		if (coef == 0) 
			return resultat;
		if (coef>0)
			if (coef != 1 || exp == 0)
				resultat += coef;
		if (coef<0)
			if (coef != -1 || exp == 0)
				resultat += coef;
			else
				resultat += "-";
		if (exp != 0)
			resultat += "X";
		if (exp != 0 && exp != 1)
			resultat += "^"+exp;
		return resultat;
	}
}
