class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: B = None
        self.r: D = None
        self.u: B = None
        self.z: E = None
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: D = None
        self.p: E = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: A = None
        self.r: E = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: G = None
        self.t: I = None
        self.z: C = None
        self.r: B = None
        self.u: J = None
        self.q: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: H = None
        self.q: A = None
        self.u: J = None
        self.o: F = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: D = None
        self.p: E = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: A = None
        self.r: E = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: G = None
        self.t: I = None
        self.z: C = None
        self.r: B = None
        self.u: J = None
        self.q: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: H = None
        self.q: A = None
        self.u: J = None
        self.o: F = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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