electicode
HomeCoursesResourcesProblemsNational OlympiadContestsLeaderboard
...

a+b+c+d

Time Limit: 1000msMemory Limit: 256MB
View Submissions

Problem Description

Given four integers aaa, bbb, ccc, ddd. You need to output:

  • in the first line - the value of aaa,
  • in the second line - the sum a+ba + ba+b,
  • in the third line - the sum a+b+ca + b + ca+b+c,
  • in the fourth line - the sum a+b+c+da + b + c + da+b+c+d.

Input Format

The input contains four integers aaa, bbb, ccc, ddd, separated by spaces. Each number does not exceed 100010001000 in absolute value.

Output Format

Output the corresponding answers on each line.

Examples

Example 1
Input
1 2 3 4
Output
1
3
6
10
Example 2
Input
2 0 2 5
Output
2
2
4
9

© 2026 Electicode. All rights reserved.