class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: E = None
        self.x: E = None
        self.t: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: J = None
        self.q: C = None
        self.r: I = None
        self.z: E = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: D = None
        self.p: H = None
        self.t: C = None
        self.w: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: I = None
        self.p: B = None
        self.w: F = None
        self.u: D = None
        self.y: H = None
        self.z: C = None
        self.o: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: J = None
        self.q: C = None
        self.r: I = None
        self.z: E = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: D = None
        self.p: H = None
        self.t: C = None
        self.w: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: I = None
        self.p: B = None
        self.w: F = None
        self.u: D = None
        self.y: H = None
        self.z: C = None
        self.o: C = None
        self.txt = txt

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

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