class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: E = None
        self.txt = txt

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

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

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

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

d = A("d")
e = B("e")
l = C("l")
j = D("j")
i = E("i")
c = D("c")

d.t = l
d.s = i
e.t = d
e.q = d
l.y = e
j.r = e
j.o = e
j.q = l
j.z = c
i.v = j
i.x = e
c.r = e
c.o = e
c.q = l
c.z = j
assert e.q.s.v.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: E = None
        self.txt = txt

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

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

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

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

d = A("d")
e = B("e")
l = C("l")
j = D("j")
i = E("i")
c = D("c")

d.t = l
d.s = i
e.t = d
e.q = d
l.y = e
j.r = e
j.o = e
j.q = l
j.z = c
i.v = j
i.x = e
c.r = e
c.o = e
c.q = l
c.z = j
assert e.q.s.v.q.y.txt == "e"