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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

f.w = c
f.u = c
f.v = c
f.o = n
c.s = f
c.p = b
e.u = c
n.y = f
n.z = i
n.v = e
n.u = c
b.x = i
i.s = n
i.x = e
assert n.u.s.u.s.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: D = None
        self.u: B = None
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

f.w = c
f.u = c
f.v = c
f.o = n
c.s = f
c.p = b
e.u = c
n.y = f
n.z = i
n.v = e
n.u = c
b.x = i
i.s = n
i.x = e
assert n.u.s.u.s.o.u.txt == "c"