#include <stdio.h>
#include <strings.h>
#include <teatime.h>

main()
{
  char buf[BUFSIZ];
  int year, month, day;
  char *c, *d;
  struct tm tm;
  char  str[32];

  while(fgets(buf, sizeof(buf), stdin))
    {
      if(!(c = index(buf, '.')))
	{
	  printf("%s\n", buf);
	  continue;
	}
      *c++ = '\0';
      year = atoi(buf);
      if(!(d = index(c, '.')))
	{
	  printf("error %s\n", buf);
	  continue;
	}
      *d++ = '\0';
      month = atoi(c);
       if(!(c = index(d, ' ')))
	{
	  printf("error %s\n", buf);
	  continue;
	}
      *c++ = '\0';
      day = atoi(d);

      sprintf(str, "%d/%d/%d",  month, day, year);
      bzero(&tm, sizeof(tm));
      tt_partime(str, &tm);
      
      printf("%d.%03d %s", year, tm.tm_yday*1000/365, c);      
    }
}
 	
