xxx = x.reshape(-1, 1).repeat(3, axis=1).ravel()[1:-1]