separated c and python solutions