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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: E = None
        self.w: F = None
        self.x: H = None
        self.r: A = None
        self.t: H = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: G = None
        self.y: D = None
        self.z: G = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: E = None
        self.w: F = None
        self.x: H = None
        self.r: A = None
        self.t: H = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: G = None
        self.y: D = None
        self.z: G = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

e.z = f
f.y = h
f.x = h
f.t = h
f.q = b
f.w = l
f.p = l
f.r = e
n.w = h
n.o = m
n.z = m
n.r = m
n.y = g
g.x = h
b.v = n
b.z = n
l.x = f
l.q = m
m.t = f
h.t = n
assert f.q.z.z.t.r.z.w.txt == "l"