using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace numerecomplexe
{
    class Complex
    {
        double real, imaginar;

        public void Citeste()
        {
            real = double.Parse(Console.ReadLine());
            imaginar = double.Parse(Console.ReadLine());
        }
        public void Scrie()
        {
            Console.WriteLine(real+" + "+ imaginar + "i");

        }

        public double Modul()
        {
            return Math.Sqrt(real * real + imaginar * imaginar);
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Complex z= new Complex();
            z.Citeste();
            z.Scrie();
            Console.WriteLine(z.Modul());
        }
    }
}
