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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: B = None
        self.q: A = None
        self.y: A = None
        self.v: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: D = None
        self.t: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: B = None
        self.q: A = None
        self.y: A = None
        self.v: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: D = None
        self.t: C = None
        self.txt = txt

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

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

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