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

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

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: H = None
        self.r: G = None
        self.w: C = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.q: C = None
        self.w: F = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: C = None
        self.q: J = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: E = None
        self.r: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: H = None
        self.r: G = None
        self.w: C = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: I = None
        self.q: C = None
        self.w: F = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: C = None
        self.q: J = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: E = None
        self.r: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: E = None
        self.txt = txt

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

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