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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: I = None
        self.p: F = None
        self.t: H = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: I = None
        self.p: F = None
        self.t: H = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: B = None
        self.txt = txt

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

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