#! /usr/bin/env python

from hmac import new
from hashlib import sha1
from sys import argv, stdin

key = argv[1] if len(argv) > 0 else ''
msg = stdin.read()

print new(key, msg=msg, digestmod=sha1).hexdigest()
