#!/usr/bin/env python

import sys
from datetime import date, timedelta

def on_help():
	print "Usage: %s 2010123" % sys.argv[0]

try:
	year = int(sys.argv[1][0:4])
	ddd = int(sys.argv[1][4:7])
	the_date = date(year, 1, 1) + timedelta(days=ddd-1)
	print the_date.strftime('%Y %m %d')
except:
	on_help()
	sys.exit(1)

