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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: E = None
        self.y: C = None
        self.s: D = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: E = None
        self.z: C = None
        self.w: A = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: A = None
        self.t: C = None
        self.w: D = None
        self.txt = txt

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

e.q = g
c.w = e
c.s = a
c.z = g
c.y = g
n.x = c
n.o = g
n.y = a
n.s = j
n.t = e
d.q = e
d.w = e
d.r = f
d.z = n
d.p = c
g.y = a
g.t = a
g.z = e
g.w = d
j.q = e
j.w = e
j.r = f
j.z = a
j.p = c
f.y = n
f.z = e
f.t = a
f.w = j
a.x = c
a.o = g
a.y = n
a.s = j
a.t = e
assert f.y.s.r.y.t.q.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: E = None
        self.y: C = None
        self.s: D = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: E = None
        self.z: C = None
        self.w: A = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: A = None
        self.t: C = None
        self.w: D = None
        self.txt = txt

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

e.q = g
c.w = e
c.s = a
c.z = g
c.y = g
n.x = c
n.o = g
n.y = a
n.s = j
n.t = e
d.q = e
d.w = e
d.r = f
d.z = n
d.p = c
g.y = a
g.t = a
g.z = e
g.w = d
j.q = e
j.w = e
j.r = f
j.z = a
j.p = c
f.y = n
f.z = e
f.t = a
f.w = j
a.x = c
a.o = g
a.y = n
a.s = j
a.t = e
assert f.y.s.r.y.t.q.w.w.txt == "e"