# Path: ppp_questionparsing_grammatical/data/exceptions.py
# class GrammaticalError(Exception):
# class QuotationError(Exception):
#     def __init__(self, expression, message):
#     def __init__(self, expression, message):


from demo6 import get_answer
from ppp_questionparsing_grammatical.data.exceptions import GrammaticalError, QuotationError, QuestionWordError
import json
import sys
import os
    if t.type == 'missing':
        return '%s%s()' % (' '*indent*INDENT_NUMBER, symbol[t.type])
    elif t.type == 'resource':
        return '%s%s("%s")' % (' '*indent*INDENT_NUMBER, symbol[t.type], t.value)
    elif t.type == 'triple':
        return stringOfTriple(t, indent)
    elif t.type in {'list', 'intersection', 'union'}:
        l = ',\n'.join(stringOfTree(x, indent+1) for x in t.list)
        return '{0}{1}([\n{2}\n{0}])'.format(' '*indent*INDENT_NUMBER, symbol[t.type], l)
    elif t.type in {'exists', 'nth', 'sort'}:
        l = stringOfTree(t.list, indent+1)
        return '{0}{1}(\n{2}\n{0})'.format(' '*indent*INDENT_NUMBER, symbol[t.type], l)
    raise TripleError(t,"Wrong triple (new datamodel connectors?).")

def process_string(s):
    return stringOfTree(get_answer(s))

if __name__ == "__main__":
    flag = False
    print('data = {')
    while True:
        try:
            s = input("")
        except EOFError:
            break
        try:
            result = process_string(s)
        except GrammaticalError:
            sys.stderr.write("#GrammaticalError:\t{0}\n".format(s))
            continue

# Path: ppp_questionparsing_grammatical/data/exceptions.py
# class GrammaticalError(Exception):
# class QuotationError(Exception):
#     def __init__(self, expression, message):
#     def __init__(self, expression, message):


# Path: demo/datasetGeneration.py
from demo6 import get_answer
from ppp_questionparsing_grammatical.data.exceptions import GrammaticalError, QuotationError, QuestionWordError
import json
import sys
import os

    if t.type == 'missing':
        return '%s%s()' % (' '*indent*INDENT_NUMBER, symbol[t.type])
    elif t.type == 'resource':
        return '%s%s("%s")' % (' '*indent*INDENT_NUMBER, symbol[t.type], t.value)
    elif t.type == 'triple':
        return stringOfTriple(t, indent)
    elif t.type in {'list', 'intersection', 'union'}:
        l = ',\n'.join(stringOfTree(x, indent+1) for x in t.list)
        return '{0}{1}([\n{2}\n{0}])'.format(' '*indent*INDENT_NUMBER, symbol[t.type], l)
    elif t.type in {'exists', 'nth', 'sort'}:
        l = stringOfTree(t.list, indent+1)
        return '{0}{1}(\n{2}\n{0})'.format(' '*indent*INDENT_NUMBER, symbol[t.type], l)
    raise TripleError(t,"Wrong triple (new datamodel connectors?).")

def process_string(s):
    return stringOfTree(get_answer(s))

if __name__ == "__main__":
    flag = False
    print('data = {')
    while True:
        try:
            s = input("")
        except EOFError:
            break
        try:
            result = process_string(s)
        except GrammaticalError:
            sys.stderr.write("#GrammaticalError:\t{0}\n".format(s))
            continue

        except QuotationError: