def rotate3(a):
    """ rotate 3x3 array clockwise by one
    0   1   2
    3   4   5
    6   7   8
    """
    save = a[0]
    a[0] = a[1]
    a[1] = a[2]
    a[2] = a[5]
    a[5] = a[8]
    a[8] = a[7]
    a[7] = a[6]
    a[6] = a[3]
    a[3] = save
    return a