class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.y: E = None
        self.t: E = None
        self.x: F = None
        self.q: H = None
        self.z: B = None
        self.s: J = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: J = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.y: E = None
        self.t: E = None
        self.x: F = None
        self.q: H = None
        self.z: B = None
        self.s: J = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: J = None
        self.txt = txt

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

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

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