#!/usr/bin/python3
import string
import random
import sys

def isInt(toTest):
	try:
		int(toTest)
		return True
	except ValueError:
		return False

if len(sys.argv) < 2:
	print ("usage: ")
	print ("rand-str length-of-string")
else:
	if isInt(sys.argv[1]):
		s = ''.join(random.choices(string.ascii_uppercase + string.digits, k=int(sys.argv[1])))
		print (s, end='')
	else:
		print ("length-of-string must be an integer")
