def to_hex(s):
    """ Transforms a string to hexadecimal notation. """
    hex_str = ' '.join("{0:02x}".format(ord(c)) for c in s)
    return '\n'.join([hex_str[i:i+48] for i in range(0, len(hex_str), 48)])