Description:


A string is finite sequence of characters over a non-empty finite set Σ.
In this problem, Σ is the set of lowercase letters.
Substring, also called factor, is a consecutive sequence of characters occurrences at least once in a string.
Now your task is simple, for two given strings, find the length of the longest common substring of them.
Here common substring means a substring of two or more strings.

Input:


The input contains exactly two lines, each line consists of no more than 250000 lowercase letters, representing a string.

Output:


The length of the longest common substring. If such string doesn't exist, print "0" instead.

Sample Input:


Sample Output:


题解:


题目大意:给定两个字符串,求出两个字符串的最长公共子串,保证字符串长度不超过250000且均为小写字母。

一道后缀自动机的模板题,可以去膜拜一下陈老师的PPT。