class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: C = None
        self.w: D = None
        self.p: F = None
        self.z: A = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: B = None
        self.v: E = None
        self.p: G = None
        self.q: H = None
        self.t: G = None
        self.z: B = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: D = None
        self.s: D = None
        self.p: H = None
        self.o: C = None
        self.t: H = None
        self.y: F = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.q: C = None
        self.x: E = None
        self.t: D = None
        self.txt = txt

b = A("b")
d = B("d")
f = C("f")
g = D("g")
l = E("l")
k = F("k")
i = G("i")
e = H("e")

b.o = e
b.w = i
d.t = l
d.q = f
d.w = g
d.p = k
d.x = k
d.z = b
f.r = g
f.w = g
f.u = d
f.z = d
f.v = l
f.p = i
f.t = i
f.q = e
g.r = i
g.v = k
l.w = g
l.q = g
l.s = g
l.p = e
l.t = e
l.o = f
l.y = k
l.z = i
k.w = f
i.t = f
i.r = f
i.x = f
i.o = b
i.p = d
i.s = l
i.q = e
e.u = g
e.p = g
e.t = g
e.q = f
e.x = l
assert d.w.r.p.w.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: C = None
        self.w: D = None
        self.p: F = None
        self.z: A = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: B = None
        self.v: E = None
        self.p: G = None
        self.q: H = None
        self.t: G = None
        self.z: B = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: D = None
        self.s: D = None
        self.p: H = None
        self.o: C = None
        self.t: H = None
        self.y: F = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.q: C = None
        self.x: E = None
        self.t: D = None
        self.txt = txt

b = A("b")
d = B("d")
f = C("f")
g = D("g")
l = E("l")
k = F("k")
i = G("i")
e = H("e")

b.o = e
b.w = i
d.t = l
d.q = f
d.w = g
d.p = k
d.x = k
d.z = b
f.r = g
f.w = g
f.u = d
f.z = d
f.v = l
f.p = i
f.t = i
f.q = e
g.r = i
g.v = k
l.w = g
l.q = g
l.s = g
l.p = e
l.t = e
l.o = f
l.y = k
l.z = i
k.w = f
i.t = f
i.r = f
i.x = f
i.o = b
i.p = d
i.s = l
i.q = e
e.u = g
e.p = g
e.t = g
e.q = f
e.x = l
assert d.w.r.p.w.v.w.txt == "f"