class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: D = None
        self.v: B = None
        self.s: B = None
        self.y: D = None
        self.p: F = None
        self.t: D = None
        self.x: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: H = None
        self.u: G = None
        self.v: E = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: F = None
        self.p: C = None
        self.x: E = None
        self.r: F = None
        self.q: D = None
        self.w: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: I = None
        self.v: D = None
        self.s: B = None
        self.y: C = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: G = None
        self.w: G = None
        self.x: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: H = None
        self.u: G = None
        self.v: E = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: F = None
        self.p: C = None
        self.x: E = None
        self.r: F = None
        self.q: D = None
        self.w: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: I = None
        self.v: D = None
        self.s: B = None
        self.y: C = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: G = None
        self.w: G = None
        self.x: F = None
        self.txt = txt

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

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

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