#t189. 验证子串

验证子串

Verifying a Substring

Problem Description

Given two strings, determine whether one of them is a substring of the other.

Input Format

Two strings, each on its own line, with length at most 200200 and containing no spaces.

Output Format

  • If the first string s1s_1 is a substring of the second string s2s_2, output s1 is substring of s2 (where s1 and s2 are the actual strings, without parentheses);
  • Otherwise, if the second string s2s_2 is a substring of the first string s1s_1, output s2 is substring of s1;
  • Otherwise, output No substring.

Note: the output strings above (including the lowercase words is substring of and No substring) must be printed exactly as shown — the judge compares them character by character, so do not alter the wording or add/remove spaces.

Sample Input

abc
dddncabca

Sample Output

abc is substring of dddncabca

Sample Explanation

abc appears inside dddncabca, so the first string is a substring of the second, and we output abc is substring of dddncabca.