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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: B = None
        self.o: E = None
        self.v: C = None
        self.x: A = None
        self.w: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: B = None
        self.o: E = None
        self.v: C = None
        self.x: A = None
        self.w: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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