class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: H = None
        self.s: A = None
        self.q: I = None
        self.o: E = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: C = None
        self.v: G = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: G = None
        self.x: G = None
        self.o: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: D = None
        self.t: C = None
        self.r: C = None
        self.p: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: H = None
        self.s: A = None
        self.q: I = None
        self.o: E = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: C = None
        self.v: G = None
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: G = None
        self.x: G = None
        self.o: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: D = None
        self.t: C = None
        self.r: C = None
        self.p: E = None
        self.txt = txt

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

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

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