class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: A = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: A = None
        self.z: A = None
        self.v: F = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: F = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: E = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: A = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: A = None
        self.z: A = None
        self.v: F = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: F = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: E = None
        self.u: B = None
        self.txt = txt

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

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

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