

class Castle:
    def __init__(self, d_, c_, id_):
        self.d = d_
        self.c = c_
        self.id = id_


class Human:
    def __init__(self, id_, a_):
        self.a = a_
        self.id = id_
        self.ans = 0


if __name__ == '__main__':
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    d = list(map(int, input().split()))
    c = list(map(int, input().split()))
    castles = []
    for i in range(m):
        tmp = Castle(d[i], c[i], i)
        castles.append(tmp)
    castles.sort(key=lambda lhs: lhs.d)
    humans = []
    for i in range(n):
        tmp = Human(i, a[i])
        humans.append(tmp)
    humans.sort(key=lambda lhs: lhs.a)

    j = 0
    s = 0
    for i in range(n):
        while j < m and humans[i].a > castles[j].d:
            s += castles[j].c
            j += 1
        humans[i].ans = s
    humans.sort(key=lambda lhs: lhs.id)
    for i in range(n):
        print(humans[i].ans, sep=' ')
