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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: C = None
        self.s: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: F = None
        self.w: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: C = None
        self.r: G = None
        self.s: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: C = None
        self.s: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: F = None
        self.w: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: C = None
        self.r: G = None
        self.s: B = None
        self.txt = txt

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

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