input split input split input split variations var1 var2 var3 var4 var

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
a = input().split()
b = input().split()
c = input().split()
variations = {
'var1': [a[0], a[1], a[2]],
'var2': [b[0], b[1], b[2]],
'var3': [c[0], c[1], c[2]],
'var4': [a[0], b[0], c[0]],
'var5': [a[1], b[1], c[1]],
'var6': [a[2], b[2], c[2]],
'var7': [a[0], b[1], c[2]],
'var8': [a[2], b[1], c[0]]}
for var in variations:
num1 = variations[var][0]
num2 = variations[var][1]
num3 = variations[var][2]
if num1 != '0' and num1 == num2 == num3:
if num1 == '1':
print("First player won")
elif num1 == '2':
print("Second player won")
break
else:
print("Draw!")