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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: E = None
        self.x: C = None
        self.y: D = None
        self.txt = txt

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

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

a.v = j
a.q = h
a.p = g
j.u = f
j.w = c
d.o = a
d.p = e
d.y = h
d.s = j
d.z = c
f.p = j
f.w = i
f.x = h
f.y = e
g.o = a
g.v = a
g.z = e
c.o = a
c.v = a
c.z = f
h.o = a
h.p = f
h.y = d
h.s = j
h.z = g
e.p = j
e.w = c
e.x = h
e.y = f
i.o = a
i.v = a
i.z = f
assert g.v.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: C = None
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: E = None
        self.x: C = None
        self.y: D = None
        self.txt = txt

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

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

a.v = j
a.q = h
a.p = g
j.u = f
j.w = c
d.o = a
d.p = e
d.y = h
d.s = j
d.z = c
f.p = j
f.w = i
f.x = h
f.y = e
g.o = a
g.v = a
g.z = e
c.o = a
c.v = a
c.z = f
h.o = a
h.p = f
h.y = d
h.s = j
h.z = g
e.p = j
e.w = c
e.x = h
e.y = f
i.o = a
i.v = a
i.z = f
assert g.v.q.p.txt == "f"