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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.s: I = None
        self.p: C = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: D = None
        self.s: D = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: H = None
        self.z: C = None
        self.o: C = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: I = None
        self.y: F = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.s: I = None
        self.p: C = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: D = None
        self.s: D = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: H = None
        self.z: C = None
        self.o: C = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: I = None
        self.y: F = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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