#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <vector> #include <algorithm> #include <map> using namespace std; typedef struct GSK { int g; int s; int k; }; int main() { char A[100]; char B[100]; GSK da; GSK db; GSK dr; int t1,t2,t3; while(scanf("%s %s",A,B)!=EOF) { sscanf(A,"%d.%d.%d",&da.g,&da.s,&da.k); sscanf(B,"%d.%d.%d",&db.g,&db.s,&db.k); t1 = da.k + db.k; t2 = da.s + db.s; t3 = da.g + db.g; dr.k = t1 % 29; dr.s = (t2 + t1/29) % 17; dr.g = (t3 + (t2 + t1/29)/17); printf("%d.%d.%d\n",dr.g,dr.s,dr.k); } return 0; }