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

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.q: I = None
        self.p: I = None
        self.u: F = None
        self.x: A = None
        self.t: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: C = None
        self.t: I = None
        self.o: D = None
        self.s: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: B = None
        self.q: J = None
        self.p: C = None
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: B = None
        self.r: D = None
        self.t: E = None
        self.y: H = None
        self.q: J = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.q: I = None
        self.p: I = None
        self.u: F = None
        self.x: A = None
        self.t: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: C = None
        self.t: I = None
        self.o: D = None
        self.s: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: B = None
        self.q: J = None
        self.p: C = None
        self.y: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: B = None
        self.r: D = None
        self.t: E = None
        self.y: H = None
        self.q: J = None
        self.txt = txt

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

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

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