output_description: If $p$ is in $s$, print Yes in a line, otherwise No.
input_description: In the first line, the text $s$ is given.  
  In the second line, the pattern $p$ is given.
attempt: from bisect import bisect_left, bisect_right, insort_left
  
  dict = {}
  keytbl = []
  q = int(input())
  for i in range(q):
      a = list(input().split())
      ki = a[1]
      if a[0] == "0":
          if ki not in dict:
              dict[ki] = []
              insort_left(keytbl, ki)
          dict[ki].append(int(a[2]))
      elif a[0] == "1":
          if ki in dict and dict[ki] != []:
              print(*dict[ki], sep="\n")
      elif a[0] == "2":
          if ki in dict:
              dict[ki] = []
      else:
          L = bisect_left(keytbl, a[1])
          R = bisect_right(keytbl, a[2], L)
          for j in range(L, R):
              for k in dict[keytbl[j]]:
                  print(keytbl[j], k)
  
problem_description: Ring
  
    
  
  Write a program which finds a pattern $p$ in a ring shaped text $s$.
  
    
  ![](https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ITP1_8_D)
samples: [{"input": "vanceknowledgetoad\n    advance", "output": "Yes"}, {"input": "vanceknowledgetoad\n    advanced", "output": "No"}]