import narzedzia.LZesp ;

class TestZespolonych
{
    public static void main (String[] args)
    {
        if ((args.length&1)==1) return ;
        LZesp[] tab = new LZesp[args.length/2] ;
        for (int i=0 ; i<args.length ; i+=2)
        {
            double re = Double.parseDouble(args[i]) ;
            double im = Double.parseDouble(args[i+1]) ;
            tab[i/2] = new LZesp(re,im) ;
        }
        LZesp suma = LZesp.zero ;
        for (int i=0 ; i<tab.length ; i++)
        {
            if (i>0) System.out.print(" + ") ;
            System.out.print(tab[i]) ;
            suma = LZesp.suma(suma,tab[i]) ;
        }
        System.out.println(" = "+suma) ;
        LZesp iloczyn = LZesp.jeden ;
        for (int i=0 ; i<tab.length ; i++)
        {
            if (i>0) System.out.print(" * ") ;
            System.out.print(tab[i]) ;
            iloczyn = LZesp.iloczyn(iloczyn,tab[i]) ;
        }
        System.out.println(" = "+iloczyn) ;
    }
}
