output_description: Print the given n messages as specified in the problem statement.
input_description: Input contains a single dataset in the following format:
  
      
      
      n
      k_1
      M_1
      k_2
      M_2
      :
      :
      k_n
      M_n
      
  
  The first line contains an integer n (1 ≤ n ≤ 1,000), which is the number of
  posts in the thread. Then 2n lines follow. Each post is represented by two
  lines: the first line contains an integer k_i (k_1 = 0, 1 ≤ k_i < i for 2 ≤ i
  ≤ n) and indicates the i-th post is a reply to the k_i-th post; the second
  line contains a string M_i and represents the message of the i-th post. k_1 is
  always 0, which means the first post is not replying to any other post, i.e.
  it is an opening post.
  
  Each message contains 1 to 50 characters, consisting of uppercase, lowercase,
  and numeric letters.
attempt: N = int(input())
  src = []
  for i in range(N):
      k = int(input())
      s = input()
      src.append((s, []))
      if i == 0:
          continue
      src[k - 1][1].append(i)
  
  
  def dfs(i, depth):
      s, ch = src[i]
      print("." * depth + s)
      for c in ch:
          dfs(c, depth + 1)
  
  
  dfs(0, 0)
  
problem_description: Input
  
  Input contains a single dataset in the following format:
  
      
      
      n
      k_1
      M_1
      k_2
      M_2
      :
      :
      k_n
      M_n
      
  
  The first line contains an integer n (1 ≤ n ≤ 1,000), which is the number of
  posts in the thread. Then 2n lines follow. Each post is represented by two
  lines: the first line contains an integer k_i (k_1 = 0, 1 ≤ k_i < i for 2 ≤ i
  ≤ n) and indicates the i-th post is a reply to the k_i-th post; the second
  line contains a string M_i and represents the message of the i-th post. k_1 is
  always 0, which means the first post is not replying to any other post, i.e.
  it is an opening post.
  
  Each message contains 1 to 50 characters, consisting of uppercase, lowercase,
  and numeric letters.
samples: [{"input": "1\n    0\n    icpc", "output": "icpc"}, {"input": "5\n    0\n    hoge\n    1\n    fuga\n    1\n    piyo\n    2\n    foobar\n    2\n    jagjag", "output": "hoge\n    .fuga\n    ..foobar\n    ..jagjag\n    .piyo"}, {"input": "8\n    0\n    jagjag\n    1\n    hogehoge\n    1\n    buhihi\n    2\n    fugafuga\n    4\n    ponyoponyo\n    5\n    evaeva\n    4\n    nowawa\n    5\n    pokemon", "output": "jagjag\n    .hogehoge\n    ..fugafuga\n    ...ponyoponyo\n    ....evaeva\n    ....pokemon\n    ...nowawa\n    .buhihi"}, {"input": "6\n    0\n    nakachan\n    1\n    fan\n    2\n    yamemasu\n    3\n    nennryou2\n    4\n    dannyaku4\n    5\n    kouzai11", "output": "nakachan\n    .fan\n    ..yamemasu\n    ...nennryou2\n    ....dannyaku4\n    .....kouzai11"}, {"input": "34\n    0\n    LoveLive\n    1\n    honoka\n    2\n    borarara\n    2\n    sunohare\n    2\n    mogyu\n    1\n    eri\n    6\n    kasikoi\n    7\n    kawaii\n    8\n    eriichika\n    1\n    kotori\n    10\n    WR\n    10\n    haetekurukotori\n    10\n    ichigo\n    1\n    umi\n    14\n    love\n    15\n    arrow\n    16\n    shoot\n    1\n    rin\n    18\n    nyanyanya\n    1\n    maki\n    20\n    6th\n    20\n    star\n    22\n    nishikino\n    1\n    nozomi\n    24\n    spiritual\n    25\n    power\n    1\n    hanayo\n    27\n    darekatasukete\n    28\n    chottomattete\n    1\n    niko\n    30\n    natsuiro\n    30\n    nikkonikkoni\n    30\n    sekaino\n    33\n    YAZAWA", "output": "LoveLive\n    .honoka\n    ..borarara\n    ..sunohare\n    ..mogyu\n    .eri\n    ..kasikoi\n    ...kawaii\n    ....eriichika\n    .kotori\n    ..WR\n    ..haetekurukotori\n    ..ichigo\n    .umi\n    ..love\n    ...arrow\n    ....shoot\n    .rin\n    ..nyanyanya\n    .maki\n    ..6th\n    ..star\n    ...nishikino\n    .nozomi\n    ..spiritual\n    ...power\n    .hanayo\n    ..darekatasukete\n    ...chottomattete\n    .niko\n    ..natsuiro\n    ..nikkonikkoni\n    ..sekaino\n    ...YAZAWA"}, {"input": "6\n    0\n    2ch\n    1\n    1ostu\n    1\n    2get\n    1\n    1otsu\n    1\n    1ostu\n    3\n    pgr", "output": "2ch\n    .1ostu\n    .2get\n    ..pgr\n    .1otsu\n    .1ostu"}]