You can put them all in series (with suitable balance for charging) or all in parallel (no balance needed for charging). Then use a switch mode dc-dc converter to get the final voltage you want.
If you connect the batteries as you have shown, please do it on a large open area of concrete, well away from buildings, pets, other people, flammable materials, and make the final connection with a wire on a long pole. They may not all explode at the same time. I would expect the top one to go up in flames first, however the lower two might also be damaged before the top one goes completely open circuit.
If you connect batteries in parallel, they absolutely need to be the same number in series in each arm. There are a few more requirements like same chemistry, same capacity, same state of charge, and same age and history of cell.