n | inputstr = str(input()) | n | |
| substr = str(input()) | | str1 = str(input()) |
| lenInputstr = len(inputstr) | | str2 = str(input()) |
| lenSubstr = len(substr) | | n = len(str1) |
| | | m = len(str2) |
| flag = -1 | | flag = -1 |
n | for i in range(lenInputstr): | n | for i in range(n): |
| if inputstr[i] == substr[0] or substr[0] == '@': | | if str1[i] == str2[0] or str2[0] == '@': |
| flag = i | | flag = i |
t | for j in range(1, lenSubstr): | t | for j in range(1, m): |
| if i + j > lenInputstr - 1 or (inputstr[i + j] != substr[j] and substr[j] != '@'): | | if i + j > n - 1 or (str1[i + j] != str2[j] and str2[j] != '@'): |
| flag = -1 | | flag = -1 |
| break | | break |
| if flag >= 0: | | if flag >= 0: |
| break | | break |
| print(flag) | | print(flag) |