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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: J = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: B = None
        self.w: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: D = None
        self.z: A = None
        self.t: H = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: D = None
        self.w: F = None
        self.q: D = None
        self.s: J = None
        self.z: D = None
        self.u: A = None
        self.y: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: B = None
        self.x: I = None
        self.y: G = None
        self.q: C = None
        self.s: I = None
        self.r: F = None
        self.u: F = None
        self.p: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: I = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: J = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: B = None
        self.w: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: D = None
        self.z: A = None
        self.t: H = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: D = None
        self.w: F = None
        self.q: D = None
        self.s: J = None
        self.z: D = None
        self.u: A = None
        self.y: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: B = None
        self.x: I = None
        self.y: G = None
        self.q: C = None
        self.s: I = None
        self.r: F = None
        self.u: F = None
        self.p: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: I = None
        self.txt = txt

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

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