import java.text.SimpleDateFormat;
import java.util.Locale;

public class Main {
    public static void main(String[] args) {
        java.util.Date problemDate = new java.util.Date(2024 - 1900, 12 - 1, 29);

        // OK, year does not depend on Locale
                System.out.println(new SimpleDateFormat("yyyy-MM-dd", Locale.GERMAN).format(problemDate));

        // week year locale dependent – surprising and likely to be misunderstood but OK
                System.out.println(new SimpleDateFormat("YYYY-MM-dd", Locale.GERMAN).format(problemDate));

        // expected to be a constant but seems to depend on OS or Locale of the computer – on our Macs it produced 2025 but on windows/linux 2024
                System.out.println(new SimpleDateFormat("YYYY-MM-dd", Locale.forLanguageTag("this_invalid_locale")).format(problemDate));

    }
}