A man has three friends. The number of ways he can invite one friend every day for dinner on six successive nights so that no friend is invited more than three times is:

a) 6
b) 24
c) 60
d) 120