Flattening structure
Solving in a slow way