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

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

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

class D:
    def __init__(self, txt: str):
        self.s: J = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: A = None
        self.y: F = None
        self.z: B = None
        self.v: J = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: J = None
        self.o: E = None
        self.p: C = None
        self.v: C = None
        self.y: G = None
        self.u: D = None
        self.z: D = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.q: A = None
        self.v: A = None
        self.y: J = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: J = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: A = None
        self.y: F = None
        self.z: B = None
        self.v: J = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: J = None
        self.o: E = None
        self.p: C = None
        self.v: C = None
        self.y: G = None
        self.u: D = None
        self.z: D = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.q: A = None
        self.v: A = None
        self.y: J = None
        self.txt = txt

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

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

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

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