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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: B = None
        self.o: G = None
        self.t: E = None
        self.r: E = None
        self.w: E = None
        self.x: H = None
        self.s: D = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: J = None
        self.v: I = None
        self.p: A = None
        self.t: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: C = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: E = None
        self.s: A = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: J = None
        self.p: D = None
        self.w: D = None
        self.y: D = None
        self.x: I = None
        self.s: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: H = None
        self.x: F = None
        self.p: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: B = None
        self.s: A = None
        self.v: A = None
        self.t: F = None
        self.q: E = None
        self.r: F = None
        self.y: C = None
        self.w: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: B = None
        self.o: G = None
        self.t: E = None
        self.r: E = None
        self.w: E = None
        self.x: H = None
        self.s: D = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: J = None
        self.v: I = None
        self.p: A = None
        self.t: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: C = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: E = None
        self.s: A = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: J = None
        self.p: D = None
        self.w: D = None
        self.y: D = None
        self.x: I = None
        self.s: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: H = None
        self.x: F = None
        self.p: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: B = None
        self.s: A = None
        self.v: A = None
        self.t: F = None
        self.q: E = None
        self.r: F = None
        self.y: C = None
        self.w: E = None
        self.txt = txt

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

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