Group the following list of shapes into 2D and 3D shapes: triangle, sphere, cylinder, square.
2D Shapes: triangle, square
3D Shapes: sphere, cylinder.
Complete the following task based on the instruction and optional input provided.### Instruction:
Group the following list of shapes into 2D and 3D shapes: triangle, sphere, cylinder, square.

### Output:
2D Shapes: triangle, square
3D Shapes: sphere, cylinder.