class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

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

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

f = A("f")
m = B("m")
j = C("j")
l = D("l")
g = E("g")
b = F("b")

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

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

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

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

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

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

f = A("f")
m = B("m")
j = C("j")
l = D("l")
g = E("g")
b = F("b")

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