from sys import stdin

for v in stdin:
    m = tuple()
    v = tuple(map(float, v.split()))
    for _ in range(len(v)):
        m += tuple(map(float, stdin.readline().split())),
    if v:
        r = v_times_m(v, m)
        print(' '.join(str(e) for e in r))
    else:
        print()