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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: E = None
        self.w: E = None
        self.z: A = None
        self.s: F = None
        self.r: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: E = None
        self.w: E = None
        self.txt = txt

h = A("h")
m = B("m")
g = C("g")
f = D("f")
i = E("i")
c = F("c")

h.z = g
h.w = f
m.x = h
m.z = h
m.q = i
m.w = i
m.s = c
m.r = c
g.p = i
g.q = m
f.x = i
i.s = c
i.z = c
i.p = g
i.t = f
i.o = m
i.v = h
c.r = i
c.q = i
c.w = i
assert c.q.z.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: E = None
        self.w: E = None
        self.z: A = None
        self.s: F = None
        self.r: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: E = None
        self.w: E = None
        self.txt = txt

h = A("h")
m = B("m")
g = C("g")
f = D("f")
i = E("i")
c = F("c")

h.z = g
h.w = f
m.x = h
m.z = h
m.q = i
m.w = i
m.s = c
m.r = c
g.p = i
g.q = m
f.x = i
i.s = c
i.z = c
i.p = g
i.t = f
i.o = m
i.v = h
c.r = i
c.q = i
c.w = i
assert c.q.z.w.s.txt == "c"