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

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

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: B = None
        self.p: A = None
        self.r: G = None
        self.x: J = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.u: F = None
        self.x: B = None
        self.y: G = None
        self.v: B = None
        self.r: F = None
        self.z: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: H = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: B = None
        self.p: A = None
        self.r: G = None
        self.x: J = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.u: F = None
        self.x: B = None
        self.y: G = None
        self.v: B = None
        self.r: F = None
        self.z: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: H = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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