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

namespace ConsoleApplication87
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            n = int.Parse(Console.ReadLine());
            for (int i = 0; i< n; i++)
            {
                string[] tokens = Console.ReadLine().Split();
                double a = double.Parse(tokens[0]);
                double b = double.Parse(tokens[1]);
                double[] num = new double[2] {a,b};
                double[] num1 = new double[1] { a, b };
                Console.WriteLine(num[0]);
                Console.WriteLine(a + b)*num1;
            } 
            Console.ReadKey();
        }
    }
}