Spoiler for Simple Solution?
They are not allowed to communicate their order in any way, other than looking at their respective hats once the game starts. So, they are only allowed to develop a strategy ahead of time that takes into account the hat numbers and who those hats are on. Any other info, like lining up in order, or winking at each other etc. is not allowed.