String subsequence

You are given two strings ss and tt with respective lengths mm and nn. Tell if ss is a subsequence of tt, that is, if there is a subset of mm positions of tt, 0j0<<jm1<n0 \le j_0 < \dots < j_{m-1} < n, such that s[i]=t[ji]s[i] = t[j_i] for all 0i<m0 \le i < m. Additionally, tell if there is just one such subset of positions.

Input

Input consists of several cases, each with ss and tt. You can assume 1|s||t|1051 \le \vert s \vert \le \vert t \vert \le 10^5, and that the words are made up of only digits and lowercase and uppercase letters.

Output

For every case, tell if there are zero solutions, just one solution, or multiple solutions.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T11:02:09.898Z

© Jutge.org, 2006–2026.
https://jutge.org