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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: A = None
        self.s: H = None
        self.o: G = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: G = None
        self.t: G = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: C = None
        self.y: A = None
        self.z: C = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: B = None
        self.y: C = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: A = None
        self.s: H = None
        self.o: G = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: G = None
        self.t: G = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: C = None
        self.y: A = None
        self.z: C = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: B = None
        self.y: C = None
        self.t: G = None
        self.txt = txt

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

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

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

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