class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: D = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: D = None
        self.r: J = None
        self.x: D = None
        self.v: F = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: I = None
        self.u: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: A = None
        self.y: A = None
        self.q: F = None
        self.x: G = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: G = None
        self.z: G = None
        self.o: I = None
        self.v: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: D = None
        self.t: G = None
        self.u: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: B = None
        self.r: F = None
        self.v: G = None
        self.q: H = None
        self.s: G = None
        self.t: C = None
        self.o: H = None
        self.p: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.p: D = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: D = None
        self.r: J = None
        self.x: D = None
        self.v: F = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: I = None
        self.u: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: A = None
        self.y: A = None
        self.q: F = None
        self.x: G = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: G = None
        self.z: G = None
        self.o: I = None
        self.v: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: D = None
        self.t: G = None
        self.u: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: B = None
        self.r: F = None
        self.v: G = None
        self.q: H = None
        self.s: G = None
        self.t: C = None
        self.o: H = None
        self.p: C = None
        self.txt = txt

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

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