class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: J = None
        self.o: I = None
        self.s: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: B = None
        self.z: B = None
        self.s: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: I = None
        self.y: A = None
        self.s: H = None
        self.v: H = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: J = None
        self.o: I = None
        self.s: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: B = None
        self.z: B = None
        self.s: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: I = None
        self.y: A = None
        self.s: H = None
        self.v: H = None
        self.z: B = None
        self.txt = txt

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

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