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

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

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

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

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

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

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

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

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

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

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

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

m.s = k
l.y = m
l.w = f
k.t = l
k.q = l
k.u = m
f.v = k
f.w = m
b.z = l
b.q = l
b.u = k
b.x = a
b.w = a
a.z = l
a.q = l
a.u = k
a.x = b
a.w = b
assert m.s.t.y.s.t.y.txt == "m"