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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.u: F = None
        self.s: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

m = A("m")
h = B("h")
i = C("i")
k = D("k")
e = E("e")
j = F("j")

m.z = i
h.r = e
h.y = m
h.u = j
h.s = j
i.r = h
i.u = m
i.q = j
k.s = e
k.x = i
e.t = k
e.y = i
e.q = m
e.r = h
j.y = k
assert h.y.z.r.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.u: F = None
        self.s: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

m = A("m")
h = B("h")
i = C("i")
k = D("k")
e = E("e")
j = F("j")

m.z = i
h.r = e
h.y = m
h.u = j
h.s = j
i.r = h
i.u = m
i.q = j
k.s = e
k.x = i
e.t = k
e.y = i
e.q = m
e.r = h
j.y = k
assert h.y.z.r.s.txt == "j"