It's also possible to put the word "and" in a proper sentence 5 times in a row:
You see that sign outside the Rose and Crown?
There's too much space between Rose and and and and and Crown.
'James while John had had had had had had had had had had had a better effect on the teacher.' is also a valid sentence
The example refers to two students, James and John, who are required by an English test to describe a man who, in the past, had suffered from a cold. John writes "The man had a cold," which the teacher marks as being incorrect, while James writes the correct "The man had had a cold." Since James' answer was right, it had had a better effect on the teacher.
The sentence can be understood more clearly by adding punctuation and emphasis:
James, while John had had "had", had had "had had"; "had had" had had a better effect on the teacher.[