class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: H = None
        self.r: C = None
        self.y: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: C = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: F = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: C = None
        self.p: A = None
        self.s: B = None
        self.z: A = None
        self.r: C = None
        self.v: F = None
        self.q: G = None
        self.x: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: A = None
        self.v: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: J = None
        self.p: B = None
        self.t: G = None
        self.q: H = None
        self.w: G = None
        self.r: E = None
        self.x: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: C = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: F = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: C = None
        self.p: A = None
        self.s: B = None
        self.z: A = None
        self.r: C = None
        self.v: F = None
        self.q: G = None
        self.x: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: A = None
        self.v: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: J = None
        self.p: B = None
        self.t: G = None
        self.q: H = None
        self.w: G = None
        self.r: E = None
        self.x: F = None
        self.txt = txt

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

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

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