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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: H = None
        self.z: G = None
        self.s: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: H = None
        self.w: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: H = None
        self.z: G = None
        self.s: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: H = None
        self.w: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: H = None
        self.txt = txt

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

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

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