# Arup Guha
# 10/12/2025
# Solution to 2025 NAQ Problem L: Triple Jump

# Get input.
n = int(input())
nums = [int(x) for x in input().split()]

# These are easy.
lo = nums[0]//3
hi = nums[-1]//3

# You can get the other number from the second smallest sum.
mid = nums[1] - 2*lo

# Ta da!
print(lo,mid,hi)
