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

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

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: F = None
        self.v: H = None
        self.t: D = None
        self.y: E = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: G = None
        self.r: A = None
        self.s: A = None
        self.v: A = None
        self.p: B = None
        self.x: H = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: F = None
        self.v: H = None
        self.t: D = None
        self.y: E = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: G = None
        self.r: A = None
        self.s: A = None
        self.v: A = None
        self.p: B = None
        self.x: H = None
        self.txt = txt

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

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