Longest Common Substring (2 Strings)

medium
Given 2 strings, print the longest common substring.

Input Format

An integer N. 2 strings S1, S1

Output Format

Print the longest common substring.

Constraints

|S1|,|S2| <= 10^5

Example

Input
11
yzpepcoding
codingpepcd
Output
coding
Previous
Lexicographical Suffixes
Next
Repeated Substrings - Kattis

Related Questions