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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: G = None
        self.y: A = None
        self.z: C = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: A = None
        self.q: C = None
        self.p: D = None
        self.u: D = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: C = None
        self.r: A = None
        self.v: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: G = None
        self.y: A = None
        self.z: C = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: A = None
        self.q: C = None
        self.p: D = None
        self.u: D = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: C = None
        self.r: A = None
        self.v: B = None
        self.txt = txt

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

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

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