class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: G = None
        self.y: G = None
        self.z: B = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: I = None
        self.w: F = None
        self.o: F = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: H = None
        self.v: D = None
        self.w: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: G = None
        self.y: G = None
        self.z: B = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: I = None
        self.w: F = None
        self.o: F = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: H = None
        self.v: D = None
        self.w: G = None
        self.txt = txt

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

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