n | s = input() | n | line = input() |
| p = input() | | pattern = input() |
| words = p.split('@') | | b = pattern.split('@') |
| n1 = s.find(words[0]) | | first_pat = line.find(b[0]) |
| l = len(words[0]) | | l = len(b[0]) |
| if l == 0: | | if l == 0: |
| l += 1 | | l += 1 |
n | while n1 != -1: | n | while first_pat != -1: |
| flag = True | | flag = True |
n | n2 = n1 | n | second_pat = first_pat |
| for i in range(1, len(words)): | | for i in range(1, len(b)): |
| if words[i] == s[n2 + len(words[i - 1]) + 1:n2 + len(words[i - 1]) + 1 + len(words[i])]: | | if b[i] == line[second_pat + len(b[i - 1]) + 1:second_pat + len(b[i - 1]) + 1 + len(b[i])]: |
| n2 = n2 + len(words[i - 1]) + 1 | | second_pat = second_pat + len(b[i - 1]) + 1 |
| else: | | else: |
n | n1 = s.find(words[0], n1 + l) | n | first_pat = line.find(b[0], first_pat + l) |
| flag = False | | flag = False |
| break | | break |
| if flag: | | if flag: |
| break | | break |
t | print(n1) | t | print(first_pat) |