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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: H = None
        self.w: H = None
        self.o: J = None
        self.p: H = None
        self.q: F = None
        self.z: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: F = None
        self.q: E = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: H = None
        self.r: G = None
        self.t: D = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: D = None
        self.v: J = None
        self.t: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: B = None
        self.w: C = None
        self.t: G = None
        self.q: E = None
        self.v: A = None
        self.r: F = None
        self.o: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: H = None
        self.w: H = None
        self.o: J = None
        self.p: H = None
        self.q: F = None
        self.z: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: F = None
        self.q: E = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: H = None
        self.r: G = None
        self.t: D = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: D = None
        self.v: J = None
        self.t: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: B = None
        self.w: C = None
        self.t: G = None
        self.q: E = None
        self.v: A = None
        self.r: F = None
        self.o: D = None
        self.txt = txt

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

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

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