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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: B = None
        self.s: H = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: G = None
        self.s: H = None
        self.v: I = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: G = None
        self.t: D = None
        self.u: A = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: I = None
        self.s: E = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: J = None
        self.q: J = None
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: H = None
        self.x: G = None
        self.o: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: B = None
        self.s: H = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: G = None
        self.s: H = None
        self.v: I = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: G = None
        self.t: D = None
        self.u: A = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: I = None
        self.s: E = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: J = None
        self.q: J = None
        self.x: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: H = None
        self.x: G = None
        self.o: C = None
        self.txt = txt

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

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