#! /usr/bin/python

import sys

test = [( 0,  -600,  -627),
        ( 1,    14,  -898),
        ( 2,   884,  -983),
        ( 3,  1725, -1143),
        ( 4,  2699, -1140),
        ( 5,  3608,  -855),
        ( 6,  4095,  -153),
        ( 7,  3121,  1729),
        ( 8,   -28,  4095),
        ( 9, -2217,   -25),
        (10, -2217,     0),
        (11, -2217,     0),
        (12, -2217,     0),
        (13, -2217,     0),
        (14, -2217,     0),
        (15, -2217,     0),
        ]

di = [t[0] for t in test]
ca = [t[1] for t in test]
cb = [t[2] for t in test]

def run():
  for l in sys.stdin:
    v = [int(i) for i in l.strip().split()]
    s = [v[22-di[i]] for i in range(16)]
    a = sum(map(lambda a,b: a*b, s, ca))/8.0
    b = sum(map(lambda a,b: a*b, s, cb))/8.0
    print l.strip(), a, b

run()
