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