class Complex implements Serializable {

    @Override
    public String toString() {
	StringBuilder result = new StringBuilder();
	result.append("(");
	result.append(re);

	if (im < 0.0)
	    result.append(" - ").append(-im);
	else if (im == 0.0)
	    result.append(" - ").append(0.0);
	else
	    result.append(" + ").append(+im);

	result.append("i)");
	return result.toString();
    }

    private  Complex(final double re, final double im);

}