class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: H = None
        self.x: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: G = None
        self.w: J = None
        self.y: G = None
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: E = None
        self.s: G = None
        self.o: C = None
        self.w: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: H = None
        self.x: I = None
        self.o: H = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: G = None
        self.w: J = None
        self.y: G = None
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: E = None
        self.s: G = None
        self.o: C = None
        self.w: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: H = None
        self.x: I = None
        self.o: H = None
        self.r: E = None
        self.txt = txt

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

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