class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: G = None
        self.p: C = None
        self.w: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: B = None
        self.y: F = None
        self.t: B = None
        self.w: F = None
        self.z: B = None
        self.x: C = None
        self.v: F = None
        self.s: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: H = None
        self.v: J = None
        self.z: J = None
        self.y: B = None
        self.x: F = None
        self.r: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: J = None
        self.r: I = None
        self.w: A = None
        self.z: I = None
        self.s: J = None
        self.o: H = None
        self.q: A = None
        self.u: C = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: B = None
        self.y: F = None
        self.t: B = None
        self.w: F = None
        self.z: B = None
        self.x: C = None
        self.v: F = None
        self.s: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: H = None
        self.v: J = None
        self.z: J = None
        self.y: B = None
        self.x: F = None
        self.r: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: J = None
        self.r: I = None
        self.w: A = None
        self.z: I = None
        self.s: J = None
        self.o: H = None
        self.q: A = None
        self.u: C = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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