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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: E = None
        self.u: A = None
        self.x: H = None
        self.v: C = None
        self.o: E = None
        self.p: A = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: D = None
        self.t: H = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: H = None
        self.w: F = None
        self.s: C = None
        self.v: C = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: G = None
        self.o: B = None
        self.z: F = None
        self.x: F = None
        self.p: F = None
        self.r: G = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: C = None
        self.s: B = None
        self.x: G = None
        self.o: B = None
        self.y: H = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: B = None
        self.x: E = None
        self.s: F = None
        self.y: D = None
        self.r: A = None
        self.o: D = None
        self.txt = txt

a = A("a")
n = B("n")
l = C("l")
f = D("f")
d = E("d")
k = F("k")
i = G("i")
h = H("h")
b = A("b")
j = A("j")

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: E = None
        self.u: A = None
        self.x: H = None
        self.v: C = None
        self.o: E = None
        self.p: A = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: D = None
        self.t: H = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: H = None
        self.w: F = None
        self.s: C = None
        self.v: C = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: G = None
        self.o: B = None
        self.z: F = None
        self.x: F = None
        self.p: F = None
        self.r: G = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: C = None
        self.s: B = None
        self.x: G = None
        self.o: B = None
        self.y: H = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: B = None
        self.x: E = None
        self.s: F = None
        self.y: D = None
        self.r: A = None
        self.o: D = None
        self.txt = txt

a = A("a")
n = B("n")
l = C("l")
f = D("f")
d = E("d")
k = F("k")
i = G("i")
h = H("h")
b = A("b")
j = A("j")

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