class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: I = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: H = None
        self.w: H = None
        self.u: E = None
        self.o: B = None
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: G = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: I = None
        self.p: H = None
        self.q: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: I = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: H = None
        self.w: H = None
        self.u: E = None
        self.o: B = None
        self.p: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: G = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: I = None
        self.p: H = None
        self.q: E = None
        self.txt = txt

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

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

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

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