A small program in python for certain requirements.