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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: E = None
        self.v: E = None
        self.z: G = None
        self.u: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: B = None
        self.x: H = None
        self.t: B = None
        self.v: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: F = None
        self.v: C = None
        self.o: H = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: E = None
        self.v: E = None
        self.z: G = None
        self.u: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: B = None
        self.x: H = None
        self.t: B = None
        self.v: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: F = None
        self.v: C = None
        self.o: H = None
        self.txt = txt

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

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

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

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

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