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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: I = None
        self.u: G = None
        self.r: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: D = None
        self.y: C = None
        self.x: J = None
        self.z: E = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: I = None
        self.u: G = None
        self.r: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: D = None
        self.y: C = None
        self.x: J = None
        self.z: E = None
        self.q: G = None
        self.txt = txt

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

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

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

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