For me the keys to this problem were revealed by this forum thread, thank you!
1) Maximum input line length was longer than I assumed.
2) I wasn't handling the case where names didn't have the "first name initials" part.
Thanks to you also, on this thread, for learning the trick on how to get the judge to return useful debugging information by forcing a TLE, too much output, etc. etc. I'm sure that'll come in handy in the future!
BTW, for those of you wrestling with problem size limits - needing to know problem sizes so you can allocate arrays and such in advance - one of the principal advances in programming languages in the past 20 years has been the widespread acceptance of languages that include data structures that can be sized at run time (to the limits of available memory), not compile time. We're not programming in Fortran or COBOL here: use the features of the language to make your life easier.

