output_description: Print one longest string that is a subsequence of both s and t. If there are
  multiple such strings, any of them will be accepted.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      s
      t
attempt: # -*- coding: utf-8 -*-
  
  import numpy as np
  
  EDPC = "https://atcoder.jp/contests/DP/"
  TDPC = "https://atcoder.jp/contests/tdpc/tasks"
  
  ### TESTCASE
  test = ""
  # test = \
  """
  axyb
  abyxb
  ans axb
  ans ayb
  """
  ############
  test = list(reversed(test.strip().splitlines()))
  if test:
  
      def input2():
          return test.pop()
  
  else:
  
      def input2():
          return input()
  
  
  ####### MAIN
  
  s = input2()
  t = input2()
  sn = len(s)
  tn = len(t)
  sv = np.array(["A"] + list(s))
  tv = np.array(["B"] + list(t))
  dp = np.zeros((sn + 1, tn + 1), dtype="int")
  
  # fill dp table
  for si in range(sn):
      flag = np.array(sv[si + 1] == tv, dtype="int")
      flag2 = np.array(np.add.accumulate(flag) > 0, dtype="int")
  
      tmp = dp[si] + flag
      tmp2 = dp[si] + flag2
  
      if (tmp == np.sort(tmp)).all():
          dp[si + 1] = tmp
      else:
          dp[si + 1] = tmp2
  
  # get ans sequence
  ans = ""
  si, ti = sn, tn
  while si:
      while dp[si][ti] == dp[si][ti - 1] and ti:
          ti -= 1
  
      if dp[si][ti] > dp[si - 1][ti]:
          ans += t[ti - 1]
  
      si -= 1
  
  # output ans
  print(ans[::-1])
  
problem_description: Statement
  
  You are given strings s and t. Find one longest string that is a subsequence
  of both s and t.
samples: [{"input": "axyb\n    abyxb", "output": "axb\n    \n\nThe answer is `axb` or `ayb`; either will be accepted.\n\n* * *"}, {"input": "aa\n    xayaz", "output": "aa\n    \n\n* * *"}, {"input": "a\n    z", "output": "The answer is `` (an empty string).\n\n* * *"}, {"input": "abracadabra\n    avadakedavra", "output": "aaadara"}]