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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: C = None
        self.x: D = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: C = None
        self.x: D = None
        self.q: A = None
        self.txt = txt

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

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

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

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

k.x = d
k.s = g
g.o = b
g.q = b
g.u = c
g.x = l
d.w = c
d.x = c
d.q = l
l.u = c
l.t = d
l.z = d
l.p = m
m.p = i
m.v = i
m.r = g
b.x = d
b.s = g
f.p = l
f.v = i
f.r = g
h.p = l
h.v = l
h.r = g
i.u = d
i.t = c
i.z = c
i.p = m
c.w = d
c.x = d
c.q = l
assert l.z.q.z.w.w.q.u.txt == "c"