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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: I = None
        self.s: G = None
        self.q: J = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.o: H = None
        self.q: A = None
        self.w: H = None
        self.u: I = None
        self.z: G = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: H = None
        self.y: H = None
        self.x: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: E = None
        self.q: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: H = None
        self.z: F = None
        self.w: B = None
        self.v: D = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: I = None
        self.s: G = None
        self.q: J = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.o: H = None
        self.q: A = None
        self.w: H = None
        self.u: I = None
        self.z: G = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: H = None
        self.y: H = None
        self.x: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: E = None
        self.q: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: H = None
        self.z: F = None
        self.w: B = None
        self.v: D = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

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

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