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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: I = None
        self.w: A = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: E = None
        self.x: B = None
        self.q: I = None
        self.r: G = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: F = None
        self.x: F = None
        self.o: E = None
        self.t: J = None
        self.p: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.z: A = None
        self.q: F = None
        self.u: C = None
        self.r: B = None
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: I = None
        self.w: A = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: E = None
        self.x: B = None
        self.q: I = None
        self.r: G = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: F = None
        self.x: F = None
        self.o: E = None
        self.t: J = None
        self.p: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.z: A = None
        self.q: F = None
        self.u: C = None
        self.r: B = None
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: D = None
        self.txt = txt

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

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