You are a college freshman and you're trying to choose a major. The only criterion you care about is how long any major would take to complete. Each major has a set of required courses which you must take, and each course comes with a set of prerequisites which should be taken before it. You can take at most 5 courses per semester. To help make your decision, you're going to write a program which calculates the minimum time to completion for any major.