class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: B = None
        self.txt = txt

i = A("i")
n = B("n")
e = C("e")

i.q = n
i.x = e
n.o = e
n.w = e
e.p = n
e.u = n
assert n.w.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: B = None
        self.txt = txt

i = A("i")
n = B("n")
e = C("e")

i.q = n
i.x = e
n.o = e
n.w = e
e.p = n
e.u = n
assert n.w.u.o.txt == "e"