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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: G = None
        self.s: A = None
        self.q: A = None
        self.t: H = None
        self.v: G = None
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: G = None
        self.t: H = None
        self.w: F = None
        self.y: F = None
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: D = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

f = A("f")
b = B("b")
a = C("a")
m = D("m")
c = E("c")
i = F("i")
k = G("k")
e = H("e")
d = E("d")

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: G = None
        self.s: A = None
        self.q: A = None
        self.t: H = None
        self.v: G = None
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: G = None
        self.t: H = None
        self.w: F = None
        self.y: F = None
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: D = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

f = A("f")
b = B("b")
a = C("a")
m = D("m")
c = E("c")
i = F("i")
k = G("k")
e = H("e")
d = E("d")

f.y = e
f.q = a
f.u = a
f.v = b
f.p = b
f.s = i
f.z = m
b.p = a
b.y = k
b.v = k
b.s = f
b.q = f
b.t = e
b.o = i
a.x = c
m.v = k
m.x = k
m.z = k
m.t = e
m.w = i
m.y = i
c.s = i
c.t = m
i.s = e
k.w = i
k.u = m
k.z = m
e.z = i
d.s = i
d.t = m
assert m.w.s.z.s.z.s.z.s.z.txt == "i"