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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: E = None
        self.u: G = None
        self.o: G = None
        self.t: A = None
        self.s: A = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: H = None
        self.r: G = None
        self.x: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.z: C = None
        self.t: B = None
        self.v: D = None
        self.o: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: E = None
        self.z: B = None
        self.t: B = None
        self.x: F = None
        self.p: F = None
        self.u: E = None
        self.w: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: E = None
        self.u: G = None
        self.o: G = None
        self.t: A = None
        self.s: A = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: H = None
        self.r: G = None
        self.x: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.z: C = None
        self.t: B = None
        self.v: D = None
        self.o: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: E = None
        self.z: B = None
        self.t: B = None
        self.x: F = None
        self.p: F = None
        self.u: E = None
        self.w: F = None
        self.txt = txt

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

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