def converttodiamondmatrix(m):
    """
    Convert to a diamond shaped matrix.

                   a
    a b c         d b
    d e f   ->   g e c
    g h i         h f
                   i

    """
    d = [ [ "" for _ in range(len(m)*2-1) ] for _ in range(2*len(m)-1) ]
    for y in range(1, 2*len(m)):
        for x in range(len(m)):
            if 0 <= y+x-len(m) < len(m):
                d[2*len(m)-y-1][2*x+y-len(m)] = m[x][y+x-len(m)]
    return d