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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: I = None
        self.t: G = None
        self.r: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: E = None
        self.z: I = None
        self.s: F = None
        self.x: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: J = None
        self.o: J = None
        self.p: I = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: J = None
        self.r: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: I = None
        self.t: G = None
        self.r: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: E = None
        self.z: I = None
        self.s: F = None
        self.x: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: J = None
        self.o: J = None
        self.p: I = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: J = None
        self.r: G = None
        self.txt = txt

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

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

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