Like almost every second version, it's a bit crappy, but it's still a piece of art :). My Java interpretation of the C++ code developed by Psyho (https://github.com/FakePsyho/cpcontests/blob/master/various/cf_huawei_2023/main.cpp) on the contest sponsored by Huawei https://codeforces.com/contest/1885/problem/A.