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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: G = None
        self.t: E = None
        self.x: D = None
        self.r: A = None
        self.txt = txt

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

h.u = m
h.w = m
h.x = b
h.y = b
h.z = n
e.s = m
e.x = m
e.r = m
e.q = i
e.z = n
e.w = h
m.w = n
m.q = e
m.z = l
b.q = m
b.s = f
l.u = f
l.s = f
l.q = b
f.y = b
i.x = l
i.u = n
d.v = f
d.s = i
d.t = l
d.x = b
d.r = h
n.v = f
n.s = i
n.t = l
n.x = b
n.r = h
assert b.s.y.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: D = None
        self.y: D = None
        self.z: H = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: G = None
        self.t: E = None
        self.x: D = None
        self.r: A = None
        self.txt = txt

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

h.u = m
h.w = m
h.x = b
h.y = b
h.z = n
e.s = m
e.x = m
e.r = m
e.q = i
e.z = n
e.w = h
m.w = n
m.q = e
m.z = l
b.q = m
b.s = f
l.u = f
l.s = f
l.q = b
f.y = b
i.x = l
i.u = n
d.v = f
d.s = i
d.t = l
d.x = b
d.r = h
n.v = f
n.s = i
n.t = l
n.x = b
n.r = h
assert b.s.y.q.z.txt == "l"