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

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

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

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

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

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

c.t = k
c.s = d
k.x = b
k.r = d
k.z = j
k.o = e
b.z = c
b.r = g
b.t = g
b.x = e
b.w = j
h.z = d
h.x = j
j.q = e
j.r = k
j.z = d
j.v = m
j.o = g
e.z = c
e.r = g
e.t = g
e.x = b
e.w = j
m.x = e
m.o = e
m.r = h
m.z = g
g.q = b
g.r = m
g.z = d
g.v = k
g.o = j
d.z = h
d.x = g
assert k.x.x.z.s.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

c.t = k
c.s = d
k.x = b
k.r = d
k.z = j
k.o = e
b.z = c
b.r = g
b.t = g
b.x = e
b.w = j
h.z = d
h.x = j
j.q = e
j.r = k
j.z = d
j.v = m
j.o = g
e.z = c
e.r = g
e.t = g
e.x = b
e.w = j
m.x = e
m.o = e
m.r = h
m.z = g
g.q = b
g.r = m
g.z = d
g.v = k
g.o = j
d.z = h
d.x = g
assert k.x.x.z.s.x.r.txt == "m"