class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: D = None
        self.r: C = None
        self.u: F = None
        self.z: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: A = None
        self.x: B = None
        self.u: C = None
        self.s: D = None
        self.y: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: A = None
        self.x: B = None
        self.u: C = None
        self.s: D = None
        self.y: D = None
        self.txt = txt

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

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