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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: A = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

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

j.x = k
j.v = l
l.o = m
l.p = m
l.t = a
l.z = a
m.s = j
m.t = k
m.w = k
m.x = k
m.p = a
a.z = l
a.y = l
a.u = k
k.o = m
k.x = m
k.q = j
k.t = j
assert a.y.t.u.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: A = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

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

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