fork download
  1. from functools import reduce
  2.  
  3. BX = int( input().split()[1] )
  4. X = [ int(x) for x in input().split() ]
  5. X = reduce( lambda a,b: a*BX+b, X )
  6.  
  7. BY = int( input().split()[1] )
  8. Y = [ int(x) for x in input().split() ]
  9. Y = reduce( lambda a,b: a*BY+b, Y )
  10.  
  11. print( '=<>'[(X<Y)+2*(X>Y)] )
Success #stdin #stdout 0.03s 10272KB
stdin
6 2
1 0 1 1 1 1
2 10
4 7
stdout
=