Program to generate random strings of specified length