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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: F = None
        self.t: F = None
        self.u: H = None
        self.y: J = None
        self.z: G = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: E = None
        self.y: I = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: B = None
        self.o: F = None
        self.p: F = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: G = None
        self.q: E = None
        self.y: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: F = None
        self.t: F = None
        self.u: H = None
        self.y: J = None
        self.z: G = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: E = None
        self.y: I = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: B = None
        self.o: F = None
        self.p: F = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: G = None
        self.q: E = None
        self.y: B = None
        self.txt = txt

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

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

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