class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: J = None
        self.u: J = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: E = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: A = None
        self.v: A = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: F = None
        self.z: B = None
        self.p: C = None
        self.q: J = None
        self.x: D = None
        self.v: G = None
        self.s: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: B = None
        self.p: D = None
        self.r: A = None
        self.o: A = None
        self.v: D = None
        self.y: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

l.r = m
l.x = b
l.u = b
g.z = b
m.t = c
m.r = i
m.y = i
a.v = k
a.s = d
a.q = g
d.y = b
i.p = j
k.u = g
k.o = l
k.v = l
k.p = l
j.r = d
j.o = i
j.z = g
j.p = m
j.q = b
j.s = b
j.x = a
j.v = k
c.s = k
c.z = g
c.p = a
c.v = a
c.r = l
c.o = l
c.y = i
b.p = g
assert m.t.y.p.q.p.z.p.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: J = None
        self.u: J = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: E = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: A = None
        self.v: A = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: F = None
        self.z: B = None
        self.p: C = None
        self.q: J = None
        self.x: D = None
        self.v: G = None
        self.s: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: B = None
        self.p: D = None
        self.r: A = None
        self.o: A = None
        self.v: D = None
        self.y: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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