This page is still under construction.

Parts of this page are still being built. What you see may change.

Calculation

Interview

Time limit2sMemory limit1024 MB

Summary
Given two integers A and B, print the larger and then the smaller of A+B and A-B.
Level

Easy1 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

Two integers A and B are given. Print the maximum and the minimum of A+B and A-B, in that order.

Input

Input is given from standard input in the following format.

A B

Output

The output consists of 2 lines.

On line 1, print the maximum of A+B and A-B.

On line 2, print the minimum of A+B and A-B.

Constraints

  • -100 ≤ A ≤ 100.
  • -100 ≤ B ≤ 100.

Examples3

  1. Example 1

    Input
    -2 1
    
    Expected output
    -1
    -3
    
  2. Example 2

    Input
    -3 -4
    
    Expected output
    1
    -7
    
  3. Example 3

    Input
    5 0
    
    Expected output
    5
    5