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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: A = None
        self.t: E = None
        self.txt = txt

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

b = A("b")
h = B("h")
a = C("a")
n = D("n")
m = E("m")

b.s = m
b.r = m
b.t = a
b.v = h
h.t = m
h.s = m
h.x = m
h.v = b
h.q = n
a.u = n
a.w = m
n.y = m
n.t = m
n.o = b
m.z = a
m.v = b
assert b.t.u.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: C = None
        self.r: E = None
        self.v: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: A = None
        self.t: E = None
        self.txt = txt

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

b = A("b")
h = B("h")
a = C("a")
n = D("n")
m = E("m")

b.s = m
b.r = m
b.t = a
b.v = h
h.t = m
h.s = m
h.x = m
h.v = b
h.q = n
a.u = n
a.w = m
n.y = m
n.t = m
n.o = b
m.z = a
m.v = b
assert b.t.u.y.z.txt == "a"