class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: F = None
        self.s: B = None
        self.q: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: A = None
        self.x: J = None
        self.z: I = None
        self.u: D = None
        self.s: G = None
        self.q: G = None
        self.w: A = None
        self.o: I = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.x: E = None
        self.z: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: D = None
        self.p: I = None
        self.o: B = None
        self.z: I = None
        self.s: B = None
        self.x: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: A = None
        self.z: C = None
        self.y: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: A = None
        self.x: J = None
        self.z: I = None
        self.u: D = None
        self.s: G = None
        self.q: G = None
        self.w: A = None
        self.o: I = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.x: E = None
        self.z: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: D = None
        self.p: I = None
        self.o: B = None
        self.z: I = None
        self.s: B = None
        self.x: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: A = None
        self.z: C = None
        self.y: A = None
        self.txt = txt

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

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

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