class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: D = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: J = None
        self.r: J = None
        self.w: F = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: I = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.x: J = None
        self.s: G = None
        self.q: I = None
        self.o: C = None
        self.r: G = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: E = None
        self.v: A = None
        self.w: C = None
        self.u: C = None
        self.z: J = None
        self.q: B = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: D = None
        self.u: D = None
        self.t: G = None
        self.s: A = None
        self.x: E = None
        self.o: J = None
        self.z: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: J = None
        self.r: J = None
        self.w: F = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: I = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.x: J = None
        self.s: G = None
        self.q: I = None
        self.o: C = None
        self.r: G = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: E = None
        self.v: A = None
        self.w: C = None
        self.u: C = None
        self.z: J = None
        self.q: B = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: D = None
        self.u: D = None
        self.t: G = None
        self.s: A = None
        self.x: E = None
        self.o: J = None
        self.z: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

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