class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: E = None
        self.s: E = None
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: A = None
        self.z: B = None
        self.r: B = None
        self.txt = txt

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

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

c = A("c")
m = B("m")
f = C("f")
b = D("b")
l = E("l")
a = F("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: A = None
        self.z: B = None
        self.r: B = None
        self.txt = txt

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

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

c = A("c")
m = B("m")
f = C("f")
b = D("b")
l = E("l")
a = F("a")

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