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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: D = None
        self.r: J = None
        self.y: H = None
        self.v: H = None
        self.w: C = None
        self.o: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: B = None
        self.q: I = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: G = None
        self.u: I = None
        self.o: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: I = None
        self.x: B = None
        self.q: F = None
        self.y: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: D = None
        self.r: J = None
        self.y: H = None
        self.v: H = None
        self.w: C = None
        self.o: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: B = None
        self.q: I = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: G = None
        self.u: I = None
        self.o: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: I = None
        self.x: B = None
        self.q: F = None
        self.y: B = None
        self.txt = txt

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

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