class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: F = None
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: I = None
        self.x: C = None
        self.v: I = None
        self.w: B = None
        self.r: B = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: C = None
        self.q: I = None
        self.u: E = None
        self.x: G = None
        self.v: B = None
        self.r: C = None
        self.o: H = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.p: A = None
        self.w: D = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: E = None
        self.y: A = None
        self.s: D = None
        self.q: E = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: I = None
        self.x: C = None
        self.v: I = None
        self.w: B = None
        self.r: B = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: C = None
        self.q: I = None
        self.u: E = None
        self.x: G = None
        self.v: B = None
        self.r: C = None
        self.o: H = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.p: A = None
        self.w: D = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: E = None
        self.y: A = None
        self.s: D = None
        self.q: E = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: F = None
        self.txt = txt

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

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