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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: B = None
        self.y: A = None
        self.v: F = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: C = None
        self.s: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: I = None
        self.u: A = None
        self.y: E = None
        self.r: A = None
        self.p: J = None
        self.o: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: I = None
        self.q: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: B = None
        self.y: A = None
        self.v: F = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: C = None
        self.s: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: I = None
        self.u: A = None
        self.y: E = None
        self.r: A = None
        self.p: J = None
        self.o: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: I = None
        self.q: F = None
        self.txt = txt

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

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