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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: D = None
        self.w: C = None
        self.o: C = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: D = None
        self.w: C = None
        self.o: C = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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