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

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

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

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

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

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

d.w = g
d.z = i
d.q = j
b.z = a
i.z = c
i.q = g
i.s = k
i.x = j
c.r = j
c.q = b
c.p = b
c.o = a
a.t = d
a.o = k
a.u = c
a.r = c
a.p = b
h.z = a
k.z = j
k.x = j
k.q = g
k.s = i
g.w = d
g.z = i
g.q = c
j.r = c
j.q = b
j.p = b
j.o = a
assert b.z.p.z.t.q.o.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

d.w = g
d.z = i
d.q = j
b.z = a
i.z = c
i.q = g
i.s = k
i.x = j
c.r = j
c.q = b
c.p = b
c.o = a
a.t = d
a.o = k
a.u = c
a.r = c
a.p = b
h.z = a
k.z = j
k.x = j
k.q = g
k.s = i
g.w = d
g.z = i
g.q = c
j.r = c
j.q = b
j.p = b
j.o = a
assert b.z.p.z.t.q.o.u.o.txt == "a"