class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: H = None
        self.r: G = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.u: G = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: J = None
        self.x: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: G = None
        self.p: H = None
        self.t: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

k = A("k")
i = B("i")
h = C("h")
l = D("l")
c = E("c")
a = F("a")
f = G("f")
m = H("m")
b = I("b")
g = J("g")

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

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.u: G = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: J = None
        self.x: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: G = None
        self.p: H = None
        self.t: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

k = A("k")
i = B("i")
h = C("h")
l = D("l")
c = E("c")
a = F("a")
f = G("f")
m = H("m")
b = I("b")
g = J("g")

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