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

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.x: F = None
        self.z: G = None
        self.y: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: J = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: I = None
        self.z: C = None
        self.w: E = None
        self.x: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.x: F = None
        self.z: G = None
        self.y: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: J = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: I = None
        self.z: C = None
        self.w: E = None
        self.x: H = None
        self.txt = txt

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

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