class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: J = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: D = None
        self.s: H = None
        self.p: B = None
        self.z: I = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: D = None
        self.q: D = None
        self.r: H = None
        self.y: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: D = None
        self.s: H = None
        self.p: B = None
        self.z: I = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: D = None
        self.q: D = None
        self.r: H = None
        self.y: E = None
        self.txt = txt

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

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