```cpp
#include<iostream>
using namespace std;
bool ifJump(int n)//数字中含有7
{
if(n%7==0)
return true;
while(n>0)
{
if(n%10==7)
return true;
n/=10;
}
return false;
}
int main()
{
int n,turn=1,num=1;
int c[4]={0,0,0,0};
cin>>n;
while(turn<=n)
{
if(ifJump(num)==true)
{
c[(num-1)%4]++;
}
else
turn++;
num++;
}
for(int i=0;i<4;i++)
cout<<c[i]<<endl;
return 0;
}