import java.util.Calendar;

public class Main {
    // 测试代码
    public static void main(String[] args) {
        Calendar cld = Calendar.getInstance();
        cld.set(1999, 11, 31);//设置日期
        while (true) {
            cld.add(Calendar.YEAR, 100);//每一次加100都保存在cld里面
            if (cld.get(Calendar.DAY_OF_WEEK) == 1) {
                break;
            }
        }
        System.out.println(cld.get(Calendar.YEAR));
    }
}