#!/usr/bin/env python
"""
    Print out a string of pseudo-random alphanumeric characters
"""
from __future__ import print_function
import string
import random
import sys

def rand_seq(length=8):
    """yield a random sequence of the given length"""

    for _ in range(length):
        yield random.choice(string.ascii_uppercase + string.digits)

if __name__ == "__main__":
    LEN = int(sys.argv[1]) if len(sys.argv) > 1 else 8
    print("".join(list(rand_seq(LEN))))
