If I hadn't missed a bus, I would arrive to school on time. If I had arrived to school on time, I would be on the English lesson then. If I had been on the English lesson, I would write the test. If I had writen the test, I wouldn't have to stay at school after the classes. If I hadn't had to stay at school after the classes, I would be at home in that time.
If I had arrived to school on time, I would be on the English lesson then.
If I had been on the English lesson, I would write the test.
If I had writen the test, I wouldn't have to stay at school after the classes.
If I hadn't had to stay at school after the classes, I would be at home in that time.