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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.v: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: E = None
        self.t: H = None
        self.p: D = None
        self.s: G = None
        self.y: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: E = None
        self.z: E = None
        self.x: G = None
        self.o: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.v: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: E = None
        self.t: H = None
        self.p: D = None
        self.s: G = None
        self.y: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: E = None
        self.z: E = None
        self.x: G = None
        self.o: H = None
        self.txt = txt

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

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