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

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

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

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

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

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

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

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

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

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

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

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

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

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

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