Under construction

Still being built. Things may change

The Hardest Part of Mahjong

Interview

Time limit1sMemory limit1024 MB

Summary
Split people who want 3-player, 4-player, or either game into 3-person and 4-person tables so everyone plays their preferred game, minimizing 3-player tables.
Level

Easy3 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

The hardest part of mahjong is finding people to play with.

To solve this, you gathered a group of players, and a large crowd showed up.

Another problem is that people do not all play the same kind of mahjong. Three-player mahjong is played by three people, and four-player mahjong is played by four. Among the NN people you gathered, some want to play only three-player mahjong, some want to play only four-player mahjong, and others do not care as long as they can play mahjong.

Your new task is to split the NN people into groups of 3 or 4 so that everyone can play the kind they want. You must also set up tables to match each kind of mahjong. You do not consider three-player mahjong real mahjong, though. If more than one setup lets everyone play the kind they want, set up as few three-player tables as possible.

Find the number of three-player tables and the number of four-player tables you need to set up.

Input

The first line contains three integers P3P_3, P4P_4, and P0P_0, separated by spaces. They are the number of people who want to play only three-player mahjong, the number who want to play only four-player mahjong, and the number who do not care.

(P3,P4,P0≥0P_3, P_4, P_0 \ge 0; 1≤P3+P4+P0≤1051 \le P_3+P_4+P_0 \le 10^5)

Output

Print the number of three-player tables T3T_3 and the number of four-player tables T4T_4, separated by a space.

If not everyone can play the kind they want, print -1 instead.

Examples2

  1. Example 1

    Input
    3 8 7
    
    Expected output
    2 3
    
  2. Example 2

    Input
    5 4 0
    
    Expected output
    -1