Functions to solve SHAD tasks.