mapping = {
    0: 'Zero',
    1: 'One',
    2: 'Two',
    3: 'Three',
    4: 'Four',
    5: 'Five',
    6: 'Six',
    7: 'Seven',
    8: 'Eight',
    9: 'Nine',
    10: 'Ten',
    11: 'Eleven',
    12: 'Twelve',
    13: 'Thirteen',
    14: 'Fourteen',
    15: 'Fifteen',
    16: 'Sixteen',
    17: 'Seventeen',
    18: 'Eighteen',
    19: 'Nineteen',
    20: 'Twenty',
    30: 'Thirty',
    40: 'Forty',
    50: 'Fifty',
    60: 'Sixty',
    70: 'Seventy',
    80: 'Eighty',
    90: 'Ninety',
    10 ** 2: 'Hundred',
    10 ** 3: 'Thousand',
    10 ** 6: 'Million',
    10 ** 9: 'Billion'
}


def integer_to_words(num):
    if num < 100 and num in mapping:
        return mapping[num]
    result = []
    quotient = 10 ** 9
    while num > 0:
        n = num / quotient
        if n > 0:
            result.append(_3block_to_words(n))
            if quotient > 1:
                result.append(mapping[quotient])
        num -= n * quotient
        quotient /= 10 ** 3
    return ' '.join(result)


def _3block_to_words(num):
    words = []
    hundreds = num / 100
    if hundreds > 0:
        words.append(mapping[hundreds])
        words.append(mapping[100])
    remainder = num % 100
    if remainder in mapping:
        if remainder != 0:
            words.append(mapping[remainder])
    else:
        teens = remainder / 10
        words.append(mapping[teens * 10])
        words.append(mapping[remainder % 10])
    return ' '.join(words)


if __name__ == '__main__':
    print integer_to_words(100)