#P11041. [2016杭电多校]Cycle

    ID: 10183 传统题 1000ms 256MiB 尝试: 2 已通过: 2 难度: 7 上传者: 标签>CF2300字符串后缀数组ST表字符串哈希KMP最小表示法

[2016杭电多校]Cycle

Cycle

Problem Description

Alice get two strings and the lengths are both N. Bored Alice wanna know whether all equal length prefix string of these two strings are CycleEqual. For example, "abc" and "bca" and "cab" are CycleEqual. So you need output N character, '0' is no, '1' is yes.

Input

The input contains multiple test cases. For each test case, the first contains one string and the second line contains one string. The lengths of strings are both N(1N10000)N(1\leq N\leq 10000).

Output

For each test case, output N characters. For ith character, if prefix strings of first i character are CycleEqual, output '1', else output '0'.

Sample Input

abc
cab
aa
aa

Sample Output

001
11

Author

ZSTU

Source

2016 Multi-University Training Contest 5