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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: B = None
        self.q: F = None
        self.o: F = None
        self.y: A = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: H = None
        self.z: G = None
        self.u: H = None
        self.s: I = None
        self.o: H = None
        self.y: J = None
        self.r: J = None
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: F = None
        self.p: D = None
        self.r: H = None
        self.z: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: C = None
        self.q: I = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: C = None
        self.r: I = None
        self.z: E = None
        self.s: B = None
        self.t: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: I = None
        self.t: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: B = None
        self.q: F = None
        self.o: F = None
        self.y: A = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: H = None
        self.z: G = None
        self.u: H = None
        self.s: I = None
        self.o: H = None
        self.y: J = None
        self.r: J = None
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: F = None
        self.p: D = None
        self.r: H = None
        self.z: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: C = None
        self.q: I = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: C = None
        self.r: I = None
        self.z: E = None
        self.s: B = None
        self.t: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: I = None
        self.t: B = None
        self.txt = txt

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

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