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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: A = None
        self.t: C = None
        self.z: J = None
        self.w: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: J = None
        self.r: D = None
        self.v: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: I = None
        self.r: F = None
        self.v: E = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: A = None
        self.t: C = None
        self.z: J = None
        self.w: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: J = None
        self.r: D = None
        self.v: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: I = None
        self.r: F = None
        self.v: E = None
        self.s: F = None
        self.txt = txt

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

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