import sys input = sys.stdin.readline S=input().strip() T=input().strip() if len(T)==1 and T in S: print(-1) sys.exit() i=0 ANS=0 L=len(T) while i