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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: C = None
        self.o: C = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.o: E = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: B = None
        self.x: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: C = None
        self.o: C = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.o: E = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: B = None
        self.x: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

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

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