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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: G = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: F = None
        self.v: B = None
        self.r: E = None
        self.x: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: E = None
        self.s: I = None
        self.q: J = None
        self.z: A = None
        self.u: B = None
        self.v: E = None
        self.x: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: G = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: F = None
        self.v: B = None
        self.r: E = None
        self.x: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: E = None
        self.s: I = None
        self.q: J = None
        self.z: A = None
        self.u: B = None
        self.v: E = None
        self.x: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: D = None
        self.txt = txt

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

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

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

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