Codeforces Round 200 (Div. 2)
B
Simple Molecules
Codeforces
1200
原题
← AC →
翻译中…

Mad scientist Mike is busy carrying out experiments in chemistry. Today he will attempt to join three atoms into one molecule.

翻译中…

A molecule consists of atoms, with some pairs of atoms connected by atomic bonds. Each atom has a valence number — the number of bonds the atom must form with other atoms. An atom can form one or multiple bonds with any other atom, but it cannot form a bond with itself. The number of bonds of an atom in the molecule must be equal to its valence number.

翻译中…

image

翻译中…

Mike knows valence numbers of the three atoms. Find a molecule that can be built from these atoms according to the stated rules, or determine that it is impossible.

翻译中…

Input

翻译中…

The single line of the input contains three space-separated integers $*a*$, $*b*$ and $*c*$ ($1 ≤ *a*, *b*, *c* ≤ 10^{6}$) — the valence numbers of the given atoms.

翻译中…

Output

翻译中…

If such a molecule can be built, print three space-separated integers — the number of bonds between the 1-st and the 2-nd, the 2-nd and the 3-rd, the 3-rd and the 1-st atoms, correspondingly. If there are multiple solutions, output any of them. If there is no solution, print "Impossible" (without the quotes).

翻译中…

Note

翻译中…

The first sample corresponds to the first figure. There are no bonds between atoms 1 and 2 in this case.

翻译中…

The second sample corresponds to the second figure. There is one or more bonds between each pair of atoms.

翻译中…

The third sample corresponds to the third figure. There is no solution, because an atom cannot form bonds with itself.

翻译中…

The configuration in the fourth figure is impossible as each atom must have at least one atomic bond.

翻译中…

样例

Input #1
1 1 2
Output #1
0 1 1
InputCopy OutputCopy
Input #2
3 4 5
Output #2
1 3 2
InputCopy OutputCopy
Input #3
4 1 1
Output #3
Impossible
InputCopy OutputCopy
题目信息
题号
344B
时间限制
1 s
内存限制
256 MB
标签
暴力
图论
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。