Which direction do most of the trains with rectangle-shaped second cars run?
most of the trains refers to MAX(count(id)); second cars refers to position = 2
SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 2 AND T1.shape = 'rectangle' GROUP BY T2.direction ORDER BY COUNT(T2.id) DESC LIMIT 1