import sys from getpass import getpass from passlib.hash import sha512_crypt passwd = input() if not sys.stdin.isatty() else getpass() print(sha512_crypt.encrypt(passwd))