class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: G = None
        self.z: D = None
        self.p: D = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: A = None
        self.p: B = None
        self.o: E = None
        self.v: D = None
        self.z: D = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: A = None
        self.p: B = None
        self.o: E = None
        self.v: D = None
        self.z: D = None
        self.x: F = None
        self.txt = txt

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

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