target = ' ' + input().lower() + ' '
graph = ' ' + input().lower() + ' '
if graph.find(target) != -1:
print(graph.count(target) + graph.count(target.rstrip() + target), graph.find(target))
else:
print(-1)
graph.count(target.rstrip() + target) # 为啥要加这句话,前面的count不是已经计算完了嘛