Calling nextInt() will leave the linefeed on the input buffers. So when you call next line, it literally reads the next linefeed to process (where it typically results in an infinite input in the case of using a loop).
Clear it first by calling nextLine() followed by the scan for the next input. An alternative which I personally use is to simply always request a nextLine and use try/catch for a cast to the type that I need.