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

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

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

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

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

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

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

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

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

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

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

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

f.q = l
f.v = d
f.z = d
d.s = g
d.z = l
j.z = e
j.q = f
j.t = f
j.x = d
l.z = d
l.w = e
c.t = e
g.t = d
e.s = g
e.z = l
assert e.z.z.s.t.txt == "d"