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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: A = None
        self.o: I = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: F = None
        self.p: A = None
        self.z: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: C = None
        self.v: C = None
        self.r: D = None
        self.u: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: A = None
        self.o: I = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: F = None
        self.p: A = None
        self.z: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: C = None
        self.v: C = None
        self.r: D = None
        self.u: E = None
        self.txt = txt

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

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

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

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