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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: D = None
        self.r: E = None
        self.q: F = None
        self.t: D = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: F = None
        self.r: B = None
        self.q: A = None
        self.p: B = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: D = None
        self.r: A = None
        self.y: C = None
        self.p: A = None
        self.txt = txt

a = A("a")
i = B("i")
d = C("d")
j = D("j")
k = E("k")
m = F("m")

a.z = m
i.r = d
d.s = a
d.u = j
d.t = j
d.r = k
d.q = m
d.z = m
j.w = m
j.t = m
j.z = m
j.r = i
j.p = i
j.q = a
k.o = i
m.w = d
m.y = d
m.q = j
m.r = a
m.p = a
assert i.r.z.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: D = None
        self.r: E = None
        self.q: F = None
        self.t: D = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: F = None
        self.r: B = None
        self.q: A = None
        self.p: B = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: D = None
        self.r: A = None
        self.y: C = None
        self.p: A = None
        self.txt = txt

a = A("a")
i = B("i")
d = C("d")
j = D("j")
k = E("k")
m = F("m")

a.z = m
i.r = d
d.s = a
d.u = j
d.t = j
d.r = k
d.q = m
d.z = m
j.w = m
j.t = m
j.z = m
j.r = i
j.p = i
j.q = a
k.o = i
m.w = d
m.y = d
m.q = j
m.r = a
m.p = a
assert i.r.z.q.w.txt == "m"