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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: J = None
        self.o: G = None
        self.v: B = None
        self.x: J = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: J = None
        self.o: G = None
        self.v: B = None
        self.x: J = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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