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

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

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

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

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

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

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

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

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

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

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

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

b.x = a
c.t = k
c.z = b
m.s = c
m.w = g
j.w = m
j.x = b
j.r = k
j.p = d
g.t = c
g.o = c
g.v = j
g.u = m
k.w = m
k.p = m
k.x = l
k.r = a
d.s = c
d.w = g
a.w = m
a.p = m
a.x = l
a.r = k
l.x = k
assert l.x.x.x.p.s.z.x.txt == "a"