You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
555 B
Python
33 lines
555 B
Python
import re
|
|
|
|
|
|
def proc(l):
|
|
r = []
|
|
for v in l:
|
|
if v.isdigit():
|
|
r.append(int(v))
|
|
else:
|
|
for ch in v:
|
|
r.append(10**10 + ord(ch))
|
|
r.append(-1)
|
|
return r
|
|
|
|
|
|
def cmp(a, b):
|
|
for i, j in zip(a, b):
|
|
if i < j:
|
|
return True
|
|
if i > j:
|
|
return False
|
|
|
|
|
|
spl = re.compile(r'(\d+|[a-zA-Z]+)')
|
|
n = int(input())
|
|
s0 = proc(spl.findall(input()))
|
|
for i in range(n):
|
|
s = proc(spl.findall(input()))
|
|
if cmp(s, s0):
|
|
print('-')
|
|
else:
|
|
print('+')
|