CSPレポートpython
"""
"""
n=int(input())
d=[0,0,0,0]
count=0
i=1
while count!=n:
if i%7==0 or '7'in str(i):
d[i%4-1]+=1
else:
count+=1
i+=1
for i in d:
print(i)
"""
"""
n=int(input())
d=[0,0,0,0]
count=0
i=1
while count!=n:
if i%7==0 or '7'in str(i):
d[i%4-1]+=1
else:
count+=1
i+=1
for i in d:
print(i)