class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: H = None
        self.y: B = None
        self.x: H = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: F = None
        self.w: H = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: H = None
        self.v: F = None
        self.o: E = None
        self.z: D = None
        self.u: G = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: G = None
        self.s: A = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: D = None
        self.y: G = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: B = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: F = None
        self.w: H = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: H = None
        self.v: F = None
        self.o: E = None
        self.z: D = None
        self.u: G = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: G = None
        self.s: A = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: D = None
        self.y: G = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: B = None
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: E = None
        self.txt = txt

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

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