Buggy python submission (verdict: Runtime Error):
                                                                                                                                      
nm = [0,31,29,31,30,31,30,31,31,30,31,30]

while True:

    m,d = map(int,raw_input().split(" "))

    if m == 0:
        break
    nd = 0 
    for i in range(m):
       nd += nm[i]

    nd += d
    n = nd%7
    if n == 1:
        print "Thursday"
    elif n == 2:
        print "Tryday"
    elif n == 3:
        print "Saturday"
    elif n == 4:
        print "Sunday"
    elif n == 5:
        print "Monday"
    elif n == 6:
        print "Tuesday"
    elif n == 7:
        print "Wednesday"
~                                  

Fixed submission:
nm = [0,31,29,31,30,31,30,31,31,30,31,30]
while True:

    m,d = map(int,raw_input().split(" "))

    if m == 0:
        break
    else:
        nd = 0
        for i in range(m):
           nd += nm[i]

        nd += d
        n = nd%7
        if n == 1:
            print "Thursday"
        elif n == 2:
            print "Friday"
        elif n == 3:
            print "Saturday"
        elif n == 4:
            print "Sunday"
        elif n == 5:
            print "Monday"
        elif n == 6:
            print "Tuesday"
        else:                                                                                                                                                                                                
            print "Wednesday"

Buggy python submission (verdict: Runtime Error):
nm = [0,31,29,31,30,31,30,31,31,30,31,30]

while True:

    m,d = map(int,raw_input().split(" "))

    if m == 0:
        break
    nd = 0 
    for i in range(m):
       nd += nm[i]

    nd += d 
    n = nd%7
    if n == 1:
        print "Thursday"
    elif n == 2:
        print "Tryday"
    elif n == 3:
        print "Saturday"
    elif n == 4:
        print "Sunday"
    elif n == 5:
        print "Monday"
    elif n == 6:
        print "Tuesday"
    else:                                                                                                                             
        print "Wednesday"
~                                                                                                                                     
~                                                                                                                                     
~                                                                                                                                     
~                              

Fixed submission:
nm = [0,31,29,31,30,31,30,31,31,30,31,30]
while True:

    m,d = map(int,raw_input().split(" "))

    if m == 0:
        break
    else:
        nd = 0
        for i in range(m):
           nd += nm[i]

        nd += d
        n = nd%7
        if n == 1:
            print "Thursday"
        elif n == 2:
            print "Friday"
        elif n == 3:
            print "Saturday"
        elif n == 4:
            print "Sunday"
        elif n == 5:
            print "Monday"
        elif n == 6:
            print "Tuesday"
        else:                                                                                                                                                                                                
            print "Wednesday"

Buggy python submission (verdict: Runtime Error):
nm = [0,31,29,31,30,31,30,31,31,30,31,30]

while True:

    m,d = map(int,raw_input().split(" "))

    if m == 0:
        break
    nd = 0 
    for i in range(m):
       nd += nm[i]

    nd += d
    n = nd%7
    if n == 1:
        print "Thursday"
    elif n == 2:
        print "Friday"                                                                                                                
    elif n == 3:
        print "Saturday"
    elif n == 4:
        print "Sunday"
    elif n == 5:
        print "Monday"
    elif n == 6:
        print "Tuesday"
    else:
        print "Wednesday"
~                                                                                                                                     
~                                                                                                                                     
~                                     

Fixed submission:
nm = [0,31,29,31,30,31,30,31,31,30,31,30]
while True:

    m,d = map(int,raw_input().split(" "))

    if m == 0:
        break
    else:
        nd = 0
        for i in range(m):
           nd += nm[i]

        nd += d
        n = nd%7
        if n == 1:
            print "Thursday"
        elif n == 2:
            print "Friday"
        elif n == 3:
            print "Saturday"
        elif n == 4:
            print "Sunday"
        elif n == 5:
            print "Monday"
        elif n == 6:
            print "Tuesday"
        else:                                                                                                                                                                                                
            print "Wednesday"

Buggy python submission (verdict: Runtime Error):
nm = [0,31,29,31,30,31,30,31,31,30,31,30]
while True:
                                                                                                                                      
    m,d = map(int,raw_input().split(" "))

    if m == 0:
        break
    else:
        nd = 0 
        for i in range(m):
           nd += nm[i]

        nd += d
        n = nd%7
        if n == 1:
            print "Thursday"
        elif n == 2:
            print "Friday"
        elif n == 3:
            print "Saturday"
        elif n == 4:
            print "Sunday"
        elif n == 5:
            print "Monday"
        elif n == 6:
            print "Tuesday"
        else:
            print "Wednesday"
~                                                                                                                                     
~                                                           

Fixed submission:
nm = [0,31,29,31,30,31,30,31,31,30,31,30]
while True:

    m,d = map(int,raw_input().split(" "))

    if m == 0:
        break
    else:
        nd = 0
        for i in range(m):
           nd += nm[i]

        nd += d
        n = nd%7
        if n == 1:
            print "Thursday"
        elif n == 2:
            print "Friday"
        elif n == 3:
            print "Saturday"
        elif n == 4:
            print "Sunday"
        elif n == 5:
            print "Monday"
        elif n == 6:
            print "Tuesday"
        else:                                                                                                                                                                                                
            print "Wednesday"