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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: E = None
        self.q: A = None
        self.txt = txt

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

b = A("b")
k = B("k")
m = C("m")
f = D("f")
i = E("i")
c = F("c")
e = B("e")
n = E("n")

b.z = c
b.p = c
b.q = e
b.w = e
b.y = m
b.t = m
k.s = n
k.w = b
m.p = f
f.u = k
f.o = i
i.v = k
i.w = n
i.q = b
c.s = e
e.s = n
e.w = b
n.v = k
n.w = i
n.q = b
assert n.v.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: B = None
        self.y: C = None
        self.w: B = None
        self.p: F = None
        self.t: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: E = None
        self.q: A = None
        self.txt = txt

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

b = A("b")
k = B("k")
m = C("m")
f = D("f")
i = E("i")
c = F("c")
e = B("e")
n = E("n")

b.z = c
b.p = c
b.q = e
b.w = e
b.y = m
b.t = m
k.s = n
k.w = b
m.p = f
f.u = k
f.o = i
i.v = k
i.w = n
i.q = b
c.s = e
e.s = n
e.w = b
n.v = k
n.w = i
n.q = b
assert n.v.s.w.txt == "i"