class A:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: H = None
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: A = None
        self.x: B = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: H = None
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: A = None
        self.x: B = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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