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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: G = None
        self.t: G = None
        self.s: A = None
        self.q: C = None
        self.v: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: G = None
        self.t: G = None
        self.s: A = None
        self.q: C = None
        self.v: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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