A. Masha and Bears

Codeforces
IDCF904A
Time2000ms
Memory256MB
Difficulty
A family consisting of father bear, mother bear and son bear owns three cars. Father bear can climb into the largest car and he likes it. Also, mother bear can climb into the middle car and she likes it. Moreover, son bear can climb into the smallest car and he likes it. It's known that the largest car is strictly larger than the middle car, and the middle car is strictly larger than the smallest car. Masha came to test these cars. She could climb into all cars, but she liked only the smallest car. It's known that a character with size _a_ can climb into some car with size _b_ if and only if _a_ ≤ _b_, he or she likes it if and only if he can climb into this car and 2_a_ ≥ _b_. You are given sizes of bears and Masha. Find out some possible integer non-negative sizes of cars. ## Input You are given four integers _V_1, _V_2, _V_3, _V__m_(1 ≤ _V__i_ ≤ 100) — sizes of father bear, mother bear, son bear and Masha, respectively. It's guaranteed that _V_1 > _V_2 > _V_3. ## Output Output three integers — sizes of father bear's car, mother bear's car and son bear's car, respectively. If there are multiple possible solutions, print any. If there is no solution, print "_\-1_" (without quotes). [samples] ## Note In first test case all conditions for cars' sizes are satisfied. In second test case there is no answer, because Masha should be able to climb into smallest car (so size of smallest car in not less than 21), but son bear should like it, so maximum possible size of it is 20.
Samples
Input #1
50 30 10 10
Output #1
50
30
10
Input #2
100 50 10 21
Output #2
\-1
API Response (JSON)
{
  "problem": {
    "name": "A. Masha and Bears",
    "description": {
      "content": "A family consisting of father bear, mother bear and son bear owns three cars. Father bear can climb into the largest car and he likes it. Also, mother bear can climb into the middle car and she likes ",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF904A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "A family consisting of father bear, mother bear and son bear owns three cars. Father bear can climb into the largest car and he likes it. Also, mother bear can climb into the middle car and she likes ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments