class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: E = None
        self.x: D = None
        self.t: D = None
        self.o: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: A = None
        self.o: B = None
        self.txt = txt

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

c = A("c")
m = B("m")
d = C("d")
i = D("i")
f = E("f")
e = F("e")
g = A("g")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: A = None
        self.o: B = None
        self.txt = txt

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

c = A("c")
m = B("m")
d = C("d")
i = D("i")
f = E("f")
e = F("e")
g = A("g")

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