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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: E = None
        self.v: H = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: I = None
        self.v: G = None
        self.u: D = None
        self.z: G = None
        self.o: J = None
        self.w: I = None
        self.x: G = None
        self.p: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: A = None
        self.v: H = None
        self.r: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: H = None
        self.s: G = None
        self.x: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: H = None
        self.x: A = None
        self.z: I = None
        self.p: I = None
        self.v: D = None
        self.y: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: E = None
        self.v: H = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: I = None
        self.v: G = None
        self.u: D = None
        self.z: G = None
        self.o: J = None
        self.w: I = None
        self.x: G = None
        self.p: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: A = None
        self.v: H = None
        self.r: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: H = None
        self.s: G = None
        self.x: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: H = None
        self.x: A = None
        self.z: I = None
        self.p: I = None
        self.v: D = None
        self.y: F = None
        self.txt = txt

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

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