def turn(face, dir):
    nface = face[:]
    if (dir == 1):
        nface = [0, face[2], face[6], face[3], face[1], face[5], face[4]]
    if (dir == 2):
        nface = [0, face[3], face[2], face[6], face[4], face[1], face[5]]
    if (dir == 3):
        nface = [0, face[4], face[1], face[3], face[6], face[5], face[2]]
    if (dir == 4):
        nface = [0, face[5], face[2], face[1], face[4], face[6], face[3]]
    return nface
def turn(face, dir):
    nface = face[:]
    if (dir == 1):
        nface = [0, face[2], face[6], face[3], face[1], face[5], face[4]]
    if (dir == 2):
        nface = [0, face[3], face[2], face[6], face[4], face[1], face[5]]
    if (dir == 3):
        nface = [0, face[4], face[1], face[3], face[6], face[5], face[2]]
    if (dir == 4):
        nface = [0, face[5], face[2], face[1], face[4], face[6], face[3]]
    return nface