The flight attendants will pass out immigration and customs documents for Japan. Tell them that you are staying in Japan and that you need both customs and immigration forms. The immigration form is a "Disembarkation / Embarkation Card". In the 'reason for stay' and 'Address in Japan' sections simply put 'Transit'. Length of stay is one day.