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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.u: F = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: F = None
        self.x: B = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: J = None
        self.y: H = None
        self.o: I = None
        self.t: H = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: F = None
        self.p: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.u: F = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: F = None
        self.x: B = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: J = None
        self.y: H = None
        self.o: I = None
        self.t: H = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: F = None
        self.p: H = None
        self.txt = txt

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

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

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