random code in C++/Python.