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

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

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

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

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

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

a = A("a")
g = B("g")
e = C("e")
c = D("c")
f = E("f")
l = F("l")

a.o = l
a.z = e
g.s = l
e.t = f
e.x = g
e.o = g
e.w = l
c.t = f
f.y = a
f.x = a
f.z = l
f.p = e
f.w = e
f.q = e
l.y = g
assert f.y.o.y.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

a = A("a")
g = B("g")
e = C("e")
c = D("c")
f = E("f")
l = F("l")

a.o = l
a.z = e
g.s = l
e.t = f
e.x = g
e.o = g
e.w = l
c.t = f
f.y = a
f.x = a
f.z = l
f.p = e
f.w = e
f.q = e
l.y = g
assert f.y.o.y.s.y.txt == "g"