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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: J = None
        self.r: A = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: G = None
        self.z: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: C = None
        self.u: H = None
        self.x: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: A = None
        self.s: E = None
        self.w: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: J = None
        self.y: C = None
        self.q: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: E = None
        self.q: G = None
        self.o: C = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: J = None
        self.r: A = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: G = None
        self.z: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: C = None
        self.u: H = None
        self.x: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: A = None
        self.s: E = None
        self.w: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: J = None
        self.y: C = None
        self.q: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: E = None
        self.q: G = None
        self.o: C = None
        self.w: F = None
        self.txt = txt

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

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