class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: C = None
        self.v: H = None
        self.x: F = None
        self.p: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: A = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: D = None
        self.p: E = None
        self.s: A = None
        self.w: G = None
        self.t: I = None
        self.o: D = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: C = None
        self.r: I = None
        self.s: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: J = None
        self.r: G = None
        self.s: D = None
        self.z: I = None
        self.t: D = None
        self.v: J = None
        self.w: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: G = None
        self.o: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: A = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: D = None
        self.p: E = None
        self.s: A = None
        self.w: G = None
        self.t: I = None
        self.o: D = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: C = None
        self.r: I = None
        self.s: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: J = None
        self.r: G = None
        self.s: D = None
        self.z: I = None
        self.t: D = None
        self.v: J = None
        self.w: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: G = None
        self.o: C = None
        self.txt = txt

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

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

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