output_description: If A and C can communicate, print `Yes`; if they cannot, print `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      a b c d
attempt: s = input()
  K = int(input())
  
  
  def sort_here(ll):  # バブルソート
      for m in range(len(ll)):
          for n in range(len(ll) - 1 - m):
              A, B = compare(ll[n], ll[n + 1])
              ll[n] = A
              ll[n + 1] = B
      return ll
  
  
  def compare_(A, B):
      # このゲームにおける比較
      # 小、大の順で返す
      a = len(A)
      b = len(B)
  
      if a > b:
          if A[:b] == B:
              return B, A
      elif b > a:
          if B[:a] == A:
              return A, B
  
      for i in range(len(min(A, B))):
          if A[i] > B[i]:
              return B, A
          elif A[i] < B[i]:
              return A, B
  
  
  def compare(A, B):
      # このゲームにおける比較
      # 小、大の順で返す
      for i in range(len(min(A, B))):
          if A[i] > B[i]:
              return B, A
          elif A[i] < B[i]:
              return A, B
  
      if len(A) < len(B):
          return A, B
      elif len(B) < len(A):
          return B, A
      else:
          raise Exception
  
  
  # まずは長さが5以下で存在しうるsubstringを準備
  i_list = []
  for i in range(1, K + 1):
      # i文字数のsutringをまずは作る
      for j in range(len(s) - i + 1):
          cand = s[j : j + i]
          if cand not in i_list:
              i_list.append(s[j : j + i])
  
  # print(i_list)
  
  # 並び替え
  i_list = sort_here(i_list)
  # print(i_list)
  
  
  # 出力
  print(i_list[K - 1])
  
problem_description: Statement
  
  Three people, A, B and C, are trying to communicate using transceivers. They
  are standing along a number line, and the coordinates of A, B and C are a, b
  and c (in meters), respectively. Two people can directly communicate when the
  distance between them is at most d meters. Determine if A and C can
  communicate, either directly or indirectly. Here, A and C can indirectly
  communicate when A and B can directly communicate and also B and C can
  directly communicate.
samples: [{"input": "4 7 9 3", "output": "Yes\n    \n\nA and B can directly communicate, and also B and C can directly communicate,\nso we should print `Yes`.\n\n* * *"}, {"input": "100 10 1 2", "output": "No\n    \n\nThey cannot communicate in this case.\n\n* * *"}, {"input": "10 10 10 1", "output": "Yes\n    \n\nThere can be multiple people at the same position.\n\n* * *"}, {"input": "1 100 2 10", "output": "Yes"}]