class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: H = None
        self.q: H = None
        self.z: D = None
        self.r: H = None
        self.s: C = None
        self.y: C = None
        self.o: E = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: A = None
        self.z: G = None
        self.q: I = None
        self.o: H = None
        self.s: I = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: D = None
        self.y: I = None
        self.z: D = None
        self.p: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: F = None
        self.u: F = None
        self.y: A = None
        self.r: A = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: F = None
        self.z: C = None
        self.s: D = None
        self.v: B = None
        self.t: B = None
        self.txt = txt

a = A("a")
g = B("g")
f = C("f")
h = D("h")
e = E("e")
m = F("m")
i = G("i")
n = H("n")
c = I("c")
d = F("d")

a.w = h
a.z = h
a.x = n
a.q = n
a.r = n
a.s = f
a.y = f
a.o = e
a.v = g
g.x = h
g.y = c
f.p = i
f.y = m
h.r = m
h.u = a
h.z = i
h.x = i
h.q = c
h.s = c
h.o = n
e.z = c
e.o = f
m.u = d
m.w = h
m.z = h
m.y = c
m.p = f
i.z = f
i.w = g
n.w = a
n.y = a
n.r = a
n.z = m
n.u = m
n.v = h
c.u = h
c.s = h
c.r = m
c.z = f
c.v = g
c.t = g
d.u = m
d.w = h
d.z = h
d.y = c
d.p = f
assert d.y.t.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: H = None
        self.q: H = None
        self.z: D = None
        self.r: H = None
        self.s: C = None
        self.y: C = None
        self.o: E = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: A = None
        self.z: G = None
        self.q: I = None
        self.o: H = None
        self.s: I = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: D = None
        self.y: I = None
        self.z: D = None
        self.p: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: F = None
        self.u: F = None
        self.y: A = None
        self.r: A = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: F = None
        self.z: C = None
        self.s: D = None
        self.v: B = None
        self.t: B = None
        self.txt = txt

a = A("a")
g = B("g")
f = C("f")
h = D("h")
e = E("e")
m = F("m")
i = G("i")
n = H("n")
c = I("c")
d = F("d")

a.w = h
a.z = h
a.x = n
a.q = n
a.r = n
a.s = f
a.y = f
a.o = e
a.v = g
g.x = h
g.y = c
f.p = i
f.y = m
h.r = m
h.u = a
h.z = i
h.x = i
h.q = c
h.s = c
h.o = n
e.z = c
e.o = f
m.u = d
m.w = h
m.z = h
m.y = c
m.p = f
i.z = f
i.w = g
n.w = a
n.y = a
n.r = a
n.z = m
n.u = m
n.v = h
c.u = h
c.s = h
c.r = m
c.z = f
c.v = g
c.t = g
d.u = m
d.w = h
d.z = h
d.y = c
d.p = f
assert d.y.t.y.z.txt == "f"