#include<stdio.h>
int main(void)
{
	int h,m,s,h1,m1,s1,h2,m2,s2;
	int g,a,b;

	scanf("%d %d %d",&h,&m,&s);
	while(h!=-1 && m!=-1 && s!=-1){
		g=h*3600+m*60+s;
		a=7200-g;
		b=a*3;
		
		h1=a/3600;
		a=a%3600;
		m1=a/60;
		s1=a%60;

		h2=b/3600;
		b=b%3600;
		m2=b/60;
		s2=b%60;
		printf("%d %d %d\n",h1,m1,s1);
		printf("%d %d %d\n",h2,m2,s2);
		scanf("%d %d %d",&h,&m,&s);
	}
	return 0;
}