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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: A = None
        self.x: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: B = None
        self.y: B = None
        self.v: C = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: E = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: A = None
        self.x: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: B = None
        self.y: B = None
        self.v: C = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: E = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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