class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: D = None
        self.w: H = None
        self.p: G = None
        self.r: A = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: D = None
        self.w: H = None
        self.p: G = None
        self.r: A = None
        self.u: H = None
        self.txt = txt

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

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

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

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