class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.txt = txt

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

f = A("f")
j = B("j")
e = C("e")
n = B("n")
i = C("i")
l = C("l")
c = C("c")
d = A("d")
g = C("g")

f.t = n
j.v = n
j.q = n
e.p = n
e.s = j
n.v = j
n.q = j
i.p = j
i.s = j
l.p = n
l.s = n
c.p = j
c.s = n
d.t = j
g.p = n
g.s = j
assert e.p.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.txt = txt

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

f = A("f")
j = B("j")
e = C("e")
n = B("n")
i = C("i")
l = C("l")
c = C("c")
d = A("d")
g = C("g")

f.t = n
j.v = n
j.q = n
e.p = n
e.s = j
n.v = j
n.q = j
i.p = j
i.s = j
l.p = n
l.s = n
c.p = j
c.s = n
d.t = j
g.p = n
g.s = j
assert e.p.q.q.txt == "n"