class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: G = None
        self.u: D = None
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: E = None
        self.r: F = None
        self.q: F = None
        self.t: F = None
        self.u: I = None
        self.v: H = None
        self.y: F = None
        self.o: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.o: H = None
        self.s: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: B = None
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: G = None
        self.w: D = None
        self.s: E = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: E = None
        self.r: F = None
        self.q: F = None
        self.t: F = None
        self.u: I = None
        self.v: H = None
        self.y: F = None
        self.o: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.o: H = None
        self.s: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: B = None
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: G = None
        self.w: D = None
        self.s: E = None
        self.t: D = None
        self.txt = txt

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

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