class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: D = None
        self.z: I = None
        self.t: I = None
        self.s: C = None
        self.o: F = None
        self.w: B = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: C = None
        self.r: I = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: G = None
        self.z: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: I = None
        self.s: C = None
        self.q: C = None
        self.o: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: C = None
        self.r: I = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: G = None
        self.z: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: I = None
        self.s: C = None
        self.q: C = None
        self.o: C = None
        self.txt = txt

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

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

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