from typing import List
from typing import Tuple


def text_to_cnf_rep(text: str) -> List[List[Tuple[str, bool]]]:
    """
    Converts a text to a CNF representation.

    :param text: The text to convert.
    :return: The CNF representation of the text.
    """

    lines = text.strip().split('\n')
    cnf_rep = []
    for line in lines:
        line = line.strip()
        sentence: List[Tuple[str, bool]] = []
        atoms = line.split(' ')
        for atom in atoms:
            atom = atom.strip()
            if atom == '':
                continue
            if atom[0] == '!' or atom[0] == '~' or atom[0] == '¬':
                sentence.append((atom[1:], False))
            else:
                sentence.append((atom, True))
        sentence.sort(key=lambda x: x[0])
        cnf_rep.append(sentence)
    return cnf_rep