while True:
    try:
        num=list(map(lambda x:int(x,16),input().split()))
        for i in num:
            print(i)
    except:
        break