require 'lcs'

def scs(u, v)
  lcs = lcs(u, v)
  u, v = u.dup, v.dup
  scs = 
  
  until lcs.empty?
    if u[0]==lcs[0] and v[0]==lcs[0]
      
      scs << lcs.slice!(0)
      u.slice!(0)
      v.slice!(0)
    elsif u[0]==lcs[0]
      
      scs << v.slice!(0)
    else
      
      scs << u.slice!(0)
    end
  end
  
  scs + u + v
end

u = 
v = 
puts