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

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

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: A = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: A = None
        self.v: D = None
        self.txt = txt

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

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

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

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