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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: H = None
        self.x: E = None
        self.v: F = None
        self.o: D = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: A = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: E = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: J = None
        self.q: J = None
        self.t: B = None
        self.s: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: D = None
        self.t: J = None
        self.w: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: H = None
        self.x: E = None
        self.v: F = None
        self.o: D = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: A = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: E = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: J = None
        self.q: J = None
        self.t: B = None
        self.s: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: D = None
        self.t: J = None
        self.w: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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