### Database Schema:
CREATE TABLE trains (
	id	INTEGER	NOT NULL	PRIMARY KEY,
	direction	TEXT	NULL	DEFAULT NULL
);

CREATE TABLE cars (
	id	INTEGER	NOT NULL	PRIMARY KEY,
	train_id	INTEGER	NULL	DEFAULT NULL,
	position	INTEGER	NULL	DEFAULT NULL,
	shape	TEXT	NULL	DEFAULT NULL,
	len	TEXT	NULL	DEFAULT NULL,
	sides	TEXT	NULL	DEFAULT NULL,
	roof	TEXT	NULL	DEFAULT NULL,
	wheels	INTEGER	NULL	DEFAULT NULL,
	load_shape	TEXT	NULL	DEFAULT NULL,
	load_num	INTEGER	NULL	DEFAULT NULL,
	foreign key (train_id) references trains (id)
);

### User's Query:
Trains that run in which direction have more rectangle-shaped cars in total?

### Extra Knowledge:
more rectangle-shaped cars refers to MAX(rectCarsNum)
SELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS rectCarsNum FROM cars WHERE shape = 'rectangle' GROUP BY train_id ) AS T2 ON T1.id = T2.train_id ORDER BY T2.rectCarsNum DESC