Moe, Larry, Joe, Curly and Shemp are five Frenchmen. Moe knows English and Chinese. Larry knows Chinese and Japanese. Joe knows Japanese and German. Curly knows German and English. Shemp knows them all: English, Chinese, Japanese and German. In how many ways can they sit in a row, such that any two neighboring persons will have no problems in communication?