const findCommonChildStr = (s) => { let s1 = s[0], s2 = s[1]; for(let i = s1.length;i >= 0; i--){ for(let j = 0; j + i <= s1.length;j++){ if(s2.indexOf(s1.substring(j,j+i)) > -1){ return s1.substring(j,j+i).length; } } } return 0; } let arr = [] const readline = require('readline'); const rl = readline.createInterface({ input:process.stdin, output:process.stdout }); rl.on('line',(line)=>{ arr.push(line) }) rl.on('close',()=>{ console.log(findCommonChildStr(arr)) })