what's what; heads or tails
Used in negative contexts, almost always as 何が何やらわからない or similar, to express complete confusion or inability to make sense of something.
See also: 何が何だか
The explanation was so difficult I couldn't make heads or tails of it.
On my first trip abroad, when I arrived at the airport I had no idea what was what.
A fixed expression combining 何 (what) with the particles が and やら (indicating uncertainty). The derivation is transparent from its components.