class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: C = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: E = None
        self.y: F = None
        self.txt = txt

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

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

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

c.s = m
c.r = f
e.s = l
e.y = m
e.o = d
m.u = c
m.y = l
f.x = l
f.y = l
f.z = i
i.s = e
i.u = e
i.o = f
l.o = m
l.p = c
l.r = c
d.o = m
d.p = c
d.r = c
assert f.z.o.y.o.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: C = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: E = None
        self.y: F = None
        self.txt = txt

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

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

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

c.s = m
c.r = f
e.s = l
e.y = m
e.o = d
m.u = c
m.y = l
f.x = l
f.y = l
f.z = i
i.s = e
i.u = e
i.o = f
l.o = m
l.p = c
l.r = c
d.o = m
d.p = c
d.r = c
assert f.z.o.y.o.u.s.txt == "m"