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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: A = None
        self.txt = txt

l = A("l")
d = B("d")
c = C("c")
a = D("a")
k = E("k")
m = F("m")
g = A("g")
j = F("j")

l.w = j
l.s = a
l.q = m
l.v = k
l.t = c
l.z = c
d.z = m
d.v = a
d.s = c
c.s = j
a.o = d
a.t = k
k.s = d
k.z = c
m.t = d
m.w = l
g.w = m
g.q = m
g.s = a
g.v = k
g.t = c
g.z = c
j.t = d
j.w = g
assert c.s.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: D = None
        self.q: F = None
        self.v: E = None
        self.t: C = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: A = None
        self.txt = txt

l = A("l")
d = B("d")
c = C("c")
a = D("a")
k = E("k")
m = F("m")
g = A("g")
j = F("j")

l.w = j
l.s = a
l.q = m
l.v = k
l.t = c
l.z = c
d.z = m
d.v = a
d.s = c
c.s = j
a.o = d
a.t = k
k.s = d
k.z = c
m.t = d
m.w = l
g.w = m
g.q = m
g.s = a
g.v = k
g.t = c
g.z = c
j.t = d
j.w = g
assert c.s.w.s.txt == "a"