#include<iostream>
#include<cstdio>
#include<vector>
#include<cmath>
using namespace std;
vector<int>s[2160001];
int main()
{
int t;
for(int i=0;i<=11;i++)
for(int j=0;j<=59;j++)
for(int z=0;z<=50;z+=10)
{
int temp=abs(66000*j+1100*z-360000*i);
if(temp>2160000)temp=4320000-temp;
s[temp].push_back(i);
s[temp].push_back(j);
s[temp].push_back(z);
}
while(scanf("%d",&t)!=EOF)
{
for(int i=0;i<s[t].size();)
{
if(s[t][i]<10)cout<<0;
cout<<s[t][i]<<":";
if(s[t][i+1]<10)cout<<0;
cout<<s[t][i+1]<<":";
if(s[t][i+2]<10)cout<<0;
cout<<s[t][i+2]<<endl;
i+=3;
}
}
return 0;
}