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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: F = None
        self.s: J = None
        self.u: I = None
        self.p: J = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: J = None
        self.r: I = None
        self.p: E = None
        self.u: I = None
        self.y: C = None
        self.t: D = None
        self.w: D = None
        self.s: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: F = None
        self.v: A = None
        self.q: C = None
        self.w: C = None
        self.s: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: H = None
        self.y: H = None
        self.s: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: F = None
        self.s: J = None
        self.u: I = None
        self.p: J = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: J = None
        self.r: I = None
        self.p: E = None
        self.u: I = None
        self.y: C = None
        self.t: D = None
        self.w: D = None
        self.s: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: F = None
        self.v: A = None
        self.q: C = None
        self.w: C = None
        self.s: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: H = None
        self.y: H = None
        self.s: G = None
        self.txt = txt

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

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