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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: F = None
        self.p: I = None
        self.u: J = None
        self.v: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: B = None
        self.r: A = None
        self.t: C = None
        self.z: C = None
        self.o: A = None
        self.s: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: F = None
        self.p: I = None
        self.u: J = None
        self.v: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: B = None
        self.r: A = None
        self.t: C = None
        self.z: C = None
        self.o: A = None
        self.s: F = None
        self.txt = txt

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

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

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

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