This page is still under construction.

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

Contest

Time limit1sMemory limit128 MB

Summary
Given 20 scores, split into two groups of 10, output each group's sum of its top 3 scores.
Level

Easy2 of 10

Topics
Sorting, Implementation
Solved
No attempts yet

Problem

An online programming contest was held. The computer clubs of W University and K University have long been rivals, so they decided to settle their rivalry through this contest.

This time, 10 students from each of the two universities took part. After a long discussion, they decided that each university's score would be the sum of the scores of its top 3 participants among the 10.

Given the scores of the participants from W University and K University, write a program that computes each university's score.

Input

The input consists of 20 lines. Lines 1 through 10 give the score of each participant from W University, and lines 11 through 20 give the score of each participant from K University, one integer per line. Every score is an integer between 0 and 100, inclusive.

Output

Print W University's score and K University's score on one line, in that order, separated by a single space.

Examples2

  1. Example 1

    Input
    23
    23
    20
    15
    15
    14
    13
    9
    7
    6
    25
    19
    17
    17
    16
    13
    12
    11
    9
    5
    
    Expected output
    66 61
    
  2. Example 2

    Input
    17
    25
    23
    25
    79
    29
    1
    61
    59
    100
    44
    74
    94
    57
    13
    54
    82
    0
    42
    45
    
    Expected output
    240 250