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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: C = None
        self.z: A = None
        self.txt = txt

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

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

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

b = A("b")
m = B("m")
g = C("g")
f = D("f")
a = E("a")
k = B("k")

b.t = k
m.r = a
m.u = g
m.z = b
g.v = b
f.t = b
f.w = m
f.r = g
f.s = a
a.x = b
a.w = f
a.z = f
k.r = a
k.u = g
k.z = b
assert m.u.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: C = None
        self.z: A = None
        self.txt = txt

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

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

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

b = A("b")
m = B("m")
g = C("g")
f = D("f")
a = E("a")
k = B("k")

b.t = k
m.r = a
m.u = g
m.z = b
g.v = b
f.t = b
f.w = m
f.r = g
f.s = a
a.x = b
a.w = f
a.z = f
k.r = a
k.u = g
k.z = b
assert m.u.v.t.txt == "k"