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

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

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

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

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

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

e = A("e")
f = B("f")
m = C("m")
c = D("c")
h = E("h")
i = F("i")
b = F("b")
d = C("d")

e.z = h
f.x = e
f.q = e
f.u = i
m.s = e
m.q = d
c.u = b
h.s = e
i.s = c
i.v = b
i.r = m
i.o = m
i.z = f
i.q = e
b.s = c
b.v = i
b.r = d
b.z = f
b.q = e
b.o = m
d.s = e
d.q = m
assert c.u.q.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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

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

e = A("e")
f = B("f")
m = C("m")
c = D("c")
h = E("h")
i = F("i")
b = F("b")
d = C("d")

e.z = h
f.x = e
f.q = e
f.u = i
m.s = e
m.q = d
c.u = b
h.s = e
i.s = c
i.v = b
i.r = m
i.o = m
i.z = f
i.q = e
b.s = c
b.v = i
b.r = d
b.z = f
b.q = e
b.o = m
d.s = e
d.q = m
assert c.u.q.z.s.txt == "e"