import java.util.*;
import java.util.regex.*;
import static java.util.stream.Collectors.*;

class Ideone {
	public static void main (String[] args)	{
        String s = "Many things went on at the Unseen University and, regrettably teaching had to be one of them. The faculty had long ago confronted this fact and had perfected various devices for avoiding it.";
        List<String> lines = Pattern.compile("\\S(.{79}\\S*|.*)").matcher(s).results().map(MatchResult::group).collect(toList());
        lines.forEach(System.out::println);
	}
}