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

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

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

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

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

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

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

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

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

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

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

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

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