import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

public class Main {
	public static void main(String args[]) {
		List<Date> dates = new ArrayList<Date>();
		Calendar calendar = Calendar.getInstance(); // 抽象クラスのため、new不可
		int year = 0, month = 0;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		System.out.print("年を入力してください：");
		try {
			year = Integer.valueOf(br.readLine()); // no good?
			//calendar.set(Calendar.YEAR, Integer.valueOf(br.readLine()));  // good?
		} catch (NumberFormatException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		System.out.print("月を入力してください：");
		try {
			month = Integer.valueOf(br.readLine()) - 1; // no good?
			//calendar.set(Calendar.MONTH, Integer.valueOf(br.readLine()) - 1); // good?
		} catch (NumberFormatException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		calendar.set(year, month, 1); // no good?
		int endMonth = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); // 現在設定されている年月の最終日を取得
		for (int day = 1; day <= endMonth; day++) {
			calendar.set(year, month, day); 
			//calendar.set(Calendar.DAY_OF_MONTH, day); // good?
			dates.add(calendar.getTime());
		}
		
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
		for (Date date : dates) {
			System.out.println(sdf.format(date));
		}
		System.out.println();
	}
}
