#include <iostream>
#include <string>
using namespace std;
bool isSevenFun(int n)
{
if (n % 7 == 0)//判断是否为7的倍数
{
return true;
}
while (n > 0)//判断是否含有7
{
int tem = n % 10;
if (tem == 7)
{
return true;
}
n = n / 10;
}
return false;
}
int main()
{
int n = 0;
cin >> n;
int suma = 0, sumb = 0, sumc = 0, sumd = 0;
for (int i = 1; ; i++)
{
if ((i % 4) == 1)
{
if (isSevenFun(i))
{
suma++;
}
}
if ((i % 4) == 2)
{
if (isSevenFun(i))
{
sumb++;
}
}
if ((i % 4) == 3)
{
if (isSevenFun(i))
{
sumc++;
}
}
if ((i % 4) == 0)
{
if (isSevenFun(i))
{
sumd++;
}
}
if ((i-suma - sumb - sumc - sumd) == n)
{
break;
}
}
cout << suma << endl;
cout << sumb << endl;
cout << sumc << endl;
cout << sumd << endl;
system("pause");
return 0;
}