class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.o: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: A = None
        self.v: E = None
        self.x: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: A = None
        self.v: E = None
        self.x: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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