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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: F = None
        self.z: H = None
        self.o: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: H = None
        self.s: H = None
        self.r: B = None
        self.p: G = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: G = None
        self.x: C = None
        self.o: D = None
        self.s: A = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: E = None
        self.v: B = None
        self.q: C = None
        self.r: C = None
        self.o: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: F = None
        self.z: H = None
        self.o: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: H = None
        self.s: H = None
        self.r: B = None
        self.p: G = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: G = None
        self.x: C = None
        self.o: D = None
        self.s: A = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: E = None
        self.v: B = None
        self.q: C = None
        self.r: C = None
        self.o: H = None
        self.txt = txt

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

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

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