class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: H = None
        self.v: D = None
        self.u: J = None
        self.r: D = None
        self.p: F = None
        self.y: B = None
        self.s: H = None
        self.o: F = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: J = None
        self.z: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: E = None
        self.v: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: J = None
        self.s: A = None
        self.u: J = None
        self.o: G = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: B = None
        self.x: D = None
        self.u: B = None
        self.txt = txt

c = A("c")
j = B("j")
f = C("f")
m = D("m")
e = E("e")
n = F("n")
l = G("l")
g = H("g")
b = I("b")
a = J("a")

c.x = f
c.z = f
c.w = g
c.s = g
c.v = m
c.r = m
c.u = a
c.p = n
c.o = n
c.y = j
j.s = f
j.x = a
j.z = g
f.w = n
f.v = g
m.o = e
m.z = e
m.v = f
e.p = g
e.y = m
n.u = m
l.y = j
l.z = g
g.x = b
g.q = a
g.u = a
g.s = c
g.o = l
g.y = e
g.t = m
b.o = j
b.z = a
a.o = m
a.x = m
a.r = j
a.u = j
assert j.x.u.x.r.z.o.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: H = None
        self.v: D = None
        self.u: J = None
        self.r: D = None
        self.p: F = None
        self.y: B = None
        self.s: H = None
        self.o: F = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: J = None
        self.z: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: E = None
        self.v: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: J = None
        self.s: A = None
        self.u: J = None
        self.o: G = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: B = None
        self.x: D = None
        self.u: B = None
        self.txt = txt

c = A("c")
j = B("j")
f = C("f")
m = D("m")
e = E("e")
n = F("n")
l = G("l")
g = H("g")
b = I("b")
a = J("a")

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