class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.z: F = None
        self.x: E = None
        self.q: D = None
        self.t: E = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: A = None
        self.y: H = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: H = None
        self.x: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: C = None
        self.s: E = None
        self.o: G = None
        self.txt = txt

a = A("a")
n = B("n")
g = C("g")
i = D("i")
b = E("b")
e = F("e")
f = G("f")
l = H("l")

a.v = l
a.z = e
a.x = b
a.t = b
a.q = i
a.y = g
n.v = g
n.w = a
n.y = l
n.r = l
g.q = i
g.o = e
g.t = f
i.s = l
i.u = l
i.x = e
b.s = a
b.z = e
e.z = g
e.o = b
e.w = b
f.o = b
f.r = n
f.t = g
l.p = f
l.o = f
l.y = g
l.s = b
assert g.o.z.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.z: F = None
        self.x: E = None
        self.q: D = None
        self.t: E = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: A = None
        self.y: H = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: H = None
        self.x: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: C = None
        self.s: E = None
        self.o: G = None
        self.txt = txt

a = A("a")
n = B("n")
g = C("g")
i = D("i")
b = E("b")
e = F("e")
f = G("f")
l = H("l")

a.v = l
a.z = e
a.x = b
a.t = b
a.q = i
a.y = g
n.v = g
n.w = a
n.y = l
n.r = l
g.q = i
g.o = e
g.t = f
i.s = l
i.u = l
i.x = e
b.s = a
b.z = e
e.z = g
e.o = b
e.w = b
f.o = b
f.r = n
f.t = g
l.p = f
l.o = f
l.y = g
l.s = b
assert g.o.z.o.w.txt == "b"