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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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