class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: G = None
        self.w: G = None
        self.p: G = None
        self.x: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: B = None
        self.w: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.x: F = None
        self.v: H = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: E = None
        self.y: F = None
        self.p: A = None
        self.z: C = None
        self.txt = txt

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

n.y = f
d.v = l
d.y = k
d.w = k
d.p = k
d.x = g
l.y = k
f.s = m
f.p = d
f.w = n
i.o = d
i.z = n
i.q = n
i.y = f
m.y = f
k.s = g
k.x = m
k.v = h
k.r = h
h.w = n
g.o = l
g.z = l
g.x = i
g.y = m
g.p = n
assert h.w.y.w.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: G = None
        self.w: G = None
        self.p: G = None
        self.x: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: B = None
        self.w: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.x: F = None
        self.v: H = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: E = None
        self.y: F = None
        self.p: A = None
        self.z: C = None
        self.txt = txt

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

n.y = f
d.v = l
d.y = k
d.w = k
d.p = k
d.x = g
l.y = k
f.s = m
f.p = d
f.w = n
i.o = d
i.z = n
i.q = n
i.y = f
m.y = f
k.s = g
k.x = m
k.v = h
k.r = h
h.w = n
g.o = l
g.z = l
g.x = i
g.y = m
g.p = n
assert h.w.y.w.y.s.txt == "m"