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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: D = None
        self.t: E = None
        self.u: E = None
        self.o: C = None
        self.txt = txt

l = A("l")
m = B("m")
g = C("g")
n = D("n")
e = E("e")
j = D("j")
b = E("b")

l.t = m
l.o = m
m.q = j
m.z = g
g.y = m
g.s = m
n.v = b
n.u = g
n.q = m
e.s = b
e.t = b
e.u = b
e.r = j
e.o = g
j.v = b
j.u = g
j.q = m
b.s = e
b.t = e
b.u = e
b.r = n
b.o = g
assert j.q.z.s.q.u.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: D = None
        self.t: E = None
        self.u: E = None
        self.o: C = None
        self.txt = txt

l = A("l")
m = B("m")
g = C("g")
n = D("n")
e = E("e")
j = D("j")
b = E("b")

l.t = m
l.o = m
m.q = j
m.z = g
g.y = m
g.s = m
n.v = b
n.u = g
n.q = m
e.s = b
e.t = b
e.u = b
e.r = j
e.o = g
j.v = b
j.u = g
j.q = m
b.s = e
b.t = e
b.u = e
b.r = n
b.o = g
assert j.q.z.s.q.u.s.z.txt == "g"