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