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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: I = None
        self.u: B = None
        self.o: I = None
        self.r: E = None
        self.v: D = None
        self.x: B = None
        self.q: B = None
        self.t: E = None
        self.w: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: F = None
        self.v: C = None
        self.q: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: A = None
        self.z: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: I = None
        self.u: B = None
        self.o: I = None
        self.r: E = None
        self.v: D = None
        self.x: B = None
        self.q: B = None
        self.t: E = None
        self.w: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: F = None
        self.v: C = None
        self.q: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: A = None
        self.z: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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