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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: B = None
        self.p: A = None
        self.z: F = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: E = None
        self.x: B = None
        self.txt = txt

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

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

a = A("a")
g = B("g")
m = C("m")
n = D("n")
l = E("l")
f = F("f")

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: B = None
        self.p: A = None
        self.z: F = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: E = None
        self.x: B = None
        self.txt = txt

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

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

a = A("a")
g = B("g")
m = C("m")
n = D("n")
l = E("l")
f = F("f")

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