class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: E = None
        self.z: F = None
        self.w: D = None
        self.u: E = None
        self.q: F = None
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.u: I = None
        self.s: F = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: J = None
        self.t: G = None
        self.p: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: J = None
        self.z: D = None
        self.r: B = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.r: A = None
        self.x: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: D = None
        self.q: F = None
        self.z: I = None
        self.v: I = None
        self.txt = txt

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

f.v = b
f.w = b
f.y = c
f.u = c
f.z = h
f.q = h
f.t = e
g.r = e
g.y = m
g.p = m
g.w = k
g.o = n
g.x = c
g.q = c
g.z = h
g.v = d
e.y = h
b.t = m
b.u = n
b.s = h
b.v = k
c.y = m
c.t = d
c.p = g
h.v = n
h.u = d
d.q = f
d.p = m
d.z = b
d.v = b
d.r = g
k.w = n
k.r = f
k.x = m
n.w = f
n.r = e
n.u = g
m.s = f
m.y = b
m.q = h
m.z = n
m.v = n
assert g.v.r.z.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: E = None
        self.z: F = None
        self.w: D = None
        self.u: E = None
        self.q: F = None
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.u: I = None
        self.s: F = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: J = None
        self.t: G = None
        self.p: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: J = None
        self.z: D = None
        self.r: B = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.r: A = None
        self.x: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: D = None
        self.q: F = None
        self.z: I = None
        self.v: I = None
        self.txt = txt

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

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