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

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

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

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

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

a = A("a")
e = B("e")
k = C("k")
j = D("j")
l = E("l")
m = D("m")
f = B("f")
b = C("b")

a.t = b
a.u = k
a.q = k
a.p = j
e.w = b
e.o = b
k.u = a
k.o = a
k.z = b
k.w = b
k.x = e
j.s = f
j.w = b
j.t = m
j.y = m
j.o = k
l.p = a
l.r = a
l.t = m
l.q = e
l.x = f
m.s = e
m.w = k
m.o = k
m.t = j
m.y = j
f.w = b
f.o = b
b.u = a
b.o = a
b.z = k
b.w = k
b.x = f
assert f.w.z.w.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: C = None
        self.q: C = None
        self.p: D = None
        self.txt = txt

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

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

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

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

a = A("a")
e = B("e")
k = C("k")
j = D("j")
l = E("l")
m = D("m")
f = B("f")
b = C("b")

a.t = b
a.u = k
a.q = k
a.p = j
e.w = b
e.o = b
k.u = a
k.o = a
k.z = b
k.w = b
k.x = e
j.s = f
j.w = b
j.t = m
j.y = m
j.o = k
l.p = a
l.r = a
l.t = m
l.q = e
l.x = f
m.s = e
m.w = k
m.o = k
m.t = j
m.y = j
f.w = b
f.o = b
b.u = a
b.o = a
b.z = k
b.w = k
b.x = f
assert f.w.z.w.x.w.txt == "b"