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

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: E = None
        self.s: B = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: F = None
        self.q: B = None
        self.v: F = None
        self.z: B = None
        self.o: D = None
        self.txt = txt

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

a = A("a")
i = B("i")
b = C("b")
m = D("m")
c = E("c")
l = F("l")

a.z = m
a.o = m
a.t = b
i.t = b
i.y = b
i.q = c
b.o = m
b.r = m
b.z = c
b.u = a
b.q = l
m.o = a
m.v = c
m.s = i
m.y = b
c.y = i
c.q = i
c.z = i
c.p = l
c.v = l
c.o = m
l.o = b
l.w = m
assert a.z.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: C = None
        self.o: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: E = None
        self.s: B = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: F = None
        self.q: B = None
        self.v: F = None
        self.z: B = None
        self.o: D = None
        self.txt = txt

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

a = A("a")
i = B("i")
b = C("b")
m = D("m")
c = E("c")
l = F("l")

a.z = m
a.o = m
a.t = b
i.t = b
i.y = b
i.q = c
b.o = m
b.r = m
b.z = c
b.u = a
b.q = l
m.o = a
m.v = c
m.s = i
m.y = b
c.y = i
c.q = i
c.z = i
c.p = l
c.v = l
c.o = m
l.o = b
l.w = m
assert a.z.s.q.txt == "c"