class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: H = None
        self.x: H = None
        self.r: F = None
        self.z: G = None
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: I = None
        self.y: I = None
        self.o: E = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: B = None
        self.q: H = None
        self.x: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: G = None
        self.t: C = None
        self.w: H = None
        self.s: H = None
        self.v: B = None
        self.y: J = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: I = None
        self.y: I = None
        self.o: E = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: B = None
        self.q: H = None
        self.x: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: G = None
        self.t: C = None
        self.w: H = None
        self.s: H = None
        self.v: B = None
        self.y: J = None
        self.txt = txt

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

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

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