class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: B = None
        self.r: B = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: A = None
        self.v: D = None
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: D = None
        self.q: B = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: A = None
        self.v: D = None
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: D = None
        self.q: B = None
        self.y: A = None
        self.txt = txt

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

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