Problem:


Card Game

  Taro and Hanako are playing card games. They have n cards each, and they compete n turns. At each turn Taro and Hanako respectively puts out a card.
  The name of the animal consisting of alphabetical letters is written on each card, and the bigger one in lexicographical order becomes the winner of that turn. The winner obtains 3 points. In the case of a draw, they obtain 1 point each.

  Write a program which reads a sequence of cards Taro and Hanako have and reports the final scores of the game.

Input

  In the first line, the number of cards n is given. In the following n lines, the cards for n turns are given respectively. For each line, the first string represents the Taro's card and the second one represents Hanako's card.

Constraints

n ≤ 1000

The length of the string ≤ 100

Output

  Print the final scores of Taro and Hanako respectively. Put a single space character between them.

Sample Input

3
cat dog
fish fish
lion tiger

Sample Output

1 7



Sample input:
3
cat dog
fish fish
lion tiger


Sample output:
1 7

Submission status: Runtime Error

Solution code:
zisyo=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
turn=int(input())
ten=[0,0]

for _ in range(turn):
    hikaku = input().split()
    if zisyo.index(hikaku[0][0])<zisyo.index(hikaku[1][0]):
        ten[1] +=3
    elif zisyo.index(hikaku[0][0]) == zisyo.index(hikaku[1][0]):
        ten[0]+=1
        ten[1]+=1
    elif zisyo.index(hikaku[0][0]) > zisyo.index(hikaku[1][0]):
        ten[0] +=3

print(" ".join(ten))

Submission status: Runtime Error

Solution code:
turn=int(input())
ten=[0,0]

for _ in range(turn):
    hikaku = input().split()
    if hikaku[0] < hikaku[1]:
        ten[1] +=3

    elif hikaku[0]) > hikaku[1]:
        ten[0] +=3

    else:
        ten[0]+=1
        ten[1]+=1

print(" ".join(map(str,ten)))

Submission status: Runtime Error

Solution code:
turn=int(input())
ten=[0,0]

for _ in range(turn):
    hikaku = list(map(int,input().split()))
    if hikaku[0] < hikaku[1]:
        ten[1] +=3

    elif hikaku[0]) > hikaku[1]:
        ten[0] +=3

    else:
        ten[0]+=1
        ten[1]+=1

print(" ".join(map(str,ten)))

Submission status: Runtime Error

Solution code:
turn=int(input())
ten=[0,0]

for _ in range(turn):
    hikaku = list(map(int,input().split()))
    if hikaku[0] < hikaku[1]:
        ten[1] +=3

    elif hikaku[0] > hikaku[1]:
        ten[0] +=3

    else:
        ten[0]+=1
        ten[1]+=1

print(" ".join(map(str,ten)))

Submission status: Runtime Error

Solution code:
t,h=0,0
int(input())
for i in range(n):
    a,b=input().split()
    if a > b:
        h+=3
    elf a < b:
        t+=3
    else:
         t+=1
         h+=1
print(t, h)

Submission status: Runtime Error

Solution code:
t,h=0,0
int(input())
for i in range(n):
    a,b=input().split()
    if a > b:
        h+=3
    elif a < b:
        t+=3
    else:
         t+=1
         h+=1
print(t, h)

Submission status: Runtime Error

Solution code:
t=0
h=0
for i in range(int(input())):
    l=input().split()
    if l[0]=l[1]:
        t+=1
        h+=1
    elif l[0]>l[1]: t+=3
    else: h+=3
print(t,h)

Submission status: Runtime Error

Solution code:
count = int(input())
Tpoint = 0
Hpoint = 0
for i in range(count):
    Twrite,Hwrite = map(str,input().split())
    if Twrite == Hwrite:
        Tpoint = Tpoint + 1
        Hpoint = Hpoint + 1
    elif Twrite > Hwrite:
        Tpoint = Tpoiny + 3
    else:
        Hpoint = Hpoint + 3
print('{0} {1}'.format(Tpoint,Hpoint))

Submission status: Runtime Error

Solution code:
def shuffle(str, m):
    return str[m:] + str[0:m]

if __name__ == '__main__':
    while True:
        str = input()
        if str == '-':
            break
        m = int(input())
        for _ in range(m):
            str = shuffle(str, int(input()))

        print(str)

Submission status: Runtime Error

Solution code:
#! python3
# card_game.py

n = int(input())
turns = [input() for i in range(n)]

taro, hanako = 0, 0
for turn in turns:
    t, h = turn.split(' ')
    min_len = len(t) if len(t) <= len(h) else len(h)

    win_flag = 0 # -1: taro, 1: hanako, 0: draw
    for i in range(min_len):
        if ord[t] < ord[h]:
            win_flag = 1
        elif ord[h] < ord[t]:
            win_flag = -1

    if win_flag == 0:
        if len(t) < len(h):
            win_flag = 1
        elif len(h) < len(t):
            win_flag = -1

    if win_flag == -1:
        taro += 3
    elif win_flag == 1:
        hanako += 3
    else:
        taro += 1
        hanako += 1

print(taro, hanako)

Submission status: Runtime Error

Solution code:
n = int(input())
a = 0
b = 0
for i in range(n):
	A,B = map(str,input().split())
	if A>B:
		a += 3
	elif B>A:
		b += 3
	else:
		a += 1
		b += 1
print('%d %d'.(a,b))

Submission status: Runtime Error

Solution code:
n=int(input())
i=0
Taro=0
Hana=0
while i<n:
    l=list(input())
    m=l.index(" ")
    #if ord(l[0])<ord(l[m+1]):
        #Hana+=1
    #elif ord(l[0])>ord(l[m+1]):
        #Taro+=1
    #else:
        #ord(l[1])
    p=0
    while True:
        if l[p]>l[m+1+p]:
            Taro+=3
            break
        elif l[p]<l[m+1+p]:
            Hana+=3
            break
        else:
            if p<m-1:
                p+=1
            elif p==m-1 and m+1+p<len(l)-2:
                Hana+=3
                break
            elif p<m-1 and m+1+p==len(l)-2:
                Taro+=3
                break
            else:
                Taro+=1
                Hana+=1
                break
    i+=1
Ans=str(Taro)+" "+str(Hana)
print(Ans)

Submission status: Runtime Error

Solution code:
n=int(raw_input())
p=[0,0]
for i in range(n):
        c=[0 for i in range(100)]
        c=map(list,raw_input().split())
        m=0
        while 1:
                if c[0]==c[1]:
                        p[0]+=1
                        p[1]+=1
                        break
                elif c[0][m]<c[1][m]:
                        p[1]+=3
                        break
                elif c[1][m]<c[0][m]:
                        p[0]+=3
                        break
                m+=1
print p[0], p[1]

Submission status: Runtime Error

Solution code:
n = int(raw_input())
score = [0,0]

for i in range(n):
    t, h = raw_input().split()
    if t < h:
        score[1] += 3
    elif t > h:
        score[0] += 3
    else:
        score += 1
print score[0], score[1]

Submission status: Runtime Error

Solution code:
score = [0, 0]

n = int(raw_input())
for i in range(n):
    t, h = raw_input().split()
    if t < h:
        score[1] += 3
    elif t > h:
        score[0] += 3
    else:
        score[] += 1
print score[0], score[1]

Submission status: WA: Presentation Error

Solution code:
#encoding=utf-8

import sys

printf = sys.stdout.write

taro = 0
hanako = 0

x = input()
for i in range(x):
    word = map(str, raw_input().split())
    if word[0] > word[1]:
        taro += 3
    elif word[0] < word[1]:
        hanako += 3
    else:
        taro += 1
        hanako += 1

print str(taro) + " ",
printf(str(hanako))

Submission status: WA: Presentation Error

Solution code:
a = 0
b = 0
num = int(input())
for i in range(num):
    s1,s2 = input().split()
    s1 = s1.lower()
    s2 = s2.lower()
    if s1 < s2:
        b += 3
    elif s1 > s2:
        a += 3
    else:
        a += 1
        b += 1
print(a,' ',b)