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

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

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

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

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

j = A("j")
l = B("l")
n = C("n")
g = D("g")
c = E("c")
h = E("h")
a = D("a")
d = C("d")

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

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

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

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

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

j = A("j")
l = B("l")
n = C("n")
g = D("g")
c = E("c")
h = E("h")
a = D("a")
d = C("d")

j.x = l
j.z = c
j.o = a
j.t = d
j.w = h
l.r = j
n.p = a
n.z = d
g.s = a
g.z = a
g.w = j
g.t = l
c.w = h
c.u = d
c.t = d
h.w = c
h.u = n
h.t = d
a.s = g
a.z = g
a.w = j
a.t = l
d.p = a
d.z = n
assert c.u.p.s.t.r.x.r.w.txt == "h"