#include <iostream>
using namespace std;
int n;
int num = 0;
int count[4] = {0};
bool judge(int num);
int main(){
scanf("%d",&n);
while(n){
num += 1;
if(judge(num)){
count[num % 4] += 1;
continue;
}
n--;
}
printf("%d\n%d\n%d\n%d",count[1],count[2],count[3],count[0]);
return 0;
}
//判断是否是7的倍数,或者是含有7的数。
bool judge(int num){
if(num % 7 == 0) return true;
while(num != 0){
if(num % 10 == 7) return true;
else num = num / 10;
}
return false;
}
09-10