Language: Java

                int N=sc.nextInt();
                int Y=sc.nextInt();

                int x=-1;
                int y=-1;
                int z=-1;

                for(int i=0;i<=N;i++){
                        for(int j=0;j<=N;j++){
                                for(int k=0;k<=N;k++){
                                        if(i+j+k==N&&1000*i+5000*j+10000*k==Y){
                                                x=i;
                                                y=j;
                                                z=k;
                                                System.out.println(z+" "+y+" "+x);
                                                i=N;
                                                j=N;
                                                k=N;
                                        }
                                }
                        }
                }
                if(x==-1){
                        System.out.println(z+" "+y+" "+x);
                }
        }
}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
                int N=sc.nextInt();
                ^
  (use --enable-preview to enable unnamed classes)
Main.java:8: error: class, interface, enum, or record expected
                for(int i=0;i<=N;i++){
                ^
Main.java:8: error: class, interface, enum, or record expected
                for(int i=0;i<=N;i++){
                            ^
Main.java:8: error: class, interface, enum, or record expected
                for(int i=0;i<=N;i++){
                                 ^
Main.java:9: error: class, interface, enum, or record expected
                        for(int j=0;j<=N;j++){
                                    ^
Main.java:9: error: class, interface, enum, or record expected
                        for(int j=0;j<=N;j++){
                                         ^
Main.java:10: error: class, interface, enum, or record expected
                                for(int k=0;k<=N;k++){
                                            ^
Main.java:10: error: class, interface, enum, or record expected
                                for(int k=0;k<=N;k++){
                                                 ^
Main.java:13: error: class, interface, enum, or record expected
                                                y=j;
                                                ^
Main.java:14: error: class, interface, enum, or record expected
                                                z=k;
                                                ^
Main.java:15: error: class, interface, enum, or record expected
                                                System.out.println(z+" "+y+" "+x);
                                                ^
Main.java:16: error: class, interface, enum, or record expected
                                                i=N;
                                                ^
Main.java:17: error: class, interface, enum, or record expected
                                                j=N;
                                                ^
Main.java:18: error: class, interface, enum, or record expected
                                                k=N;
                                                ^
Main.java:19: error: class, interface, enum, or record expected
                                        }
                                        ^
Main.java:25: error: class, interface, enum, or record expected
                }
                ^
16 errors