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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: I = None
        self.x: G = None
        self.p: J = None
        self.z: C = None
        self.o: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: D = None
        self.q: I = None
        self.w: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: J = None
        self.p: E = None
        self.r: F = None
        self.t: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: I = None
        self.x: G = None
        self.p: J = None
        self.z: C = None
        self.o: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: D = None
        self.q: I = None
        self.w: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: J = None
        self.p: E = None
        self.r: F = None
        self.t: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: F = None
        self.txt = txt

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

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

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