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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: E = None
        self.o: C = None
        self.y: F = None
        self.u: F = None
        self.txt = txt

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

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

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

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

i = A("i")
n = B("n")
d = C("d")
e = D("e")
a = E("a")
b = F("b")

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: E = None
        self.o: C = None
        self.y: F = None
        self.u: F = None
        self.txt = txt

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

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

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

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

i = A("i")
n = B("n")
d = C("d")
e = D("e")
a = E("a")
b = F("b")

i.y = n
n.w = i
n.s = a
n.o = d
n.y = b
n.u = b
d.s = n
e.t = a
e.z = i
a.x = d
b.y = e
b.v = d
b.s = a
assert n.u.s.x.s.w.y.txt == "n"