class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: C = None
        self.s: D = None
        self.u: A = None
        self.q: C = None
        self.z: C = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: C = None
        self.p: G = None
        self.r: A = None
        self.v: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: B = None
        self.x: B = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: F = None
        self.x: F = None
        self.txt = txt

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

h.u = j
h.o = l
f.w = h
f.u = h
f.x = l
f.q = l
f.z = l
f.s = e
f.o = e
l.x = h
e.w = l
e.z = h
e.r = h
e.o = h
e.u = f
e.x = k
e.y = d
a.s = i
a.z = l
a.p = j
a.r = h
a.v = d
k.q = i
g.w = f
g.u = d
g.x = d
g.o = i
i.o = a
i.v = k
i.x = k
d.w = h
d.u = h
d.x = l
d.q = l
d.z = l
d.s = e
d.o = e
j.w = d
j.u = d
j.x = d
j.o = i
assert l.x.u.o.o.z.x.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: C = None
        self.s: D = None
        self.u: A = None
        self.q: C = None
        self.z: C = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: C = None
        self.p: G = None
        self.r: A = None
        self.v: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: B = None
        self.x: B = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: F = None
        self.x: F = None
        self.txt = txt

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

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