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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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

d.q = a
d.w = a
d.t = e
d.z = e
d.v = n
b.o = e
b.u = d
e.p = a
e.x = a
i.r = n
a.s = d
a.o = e
n.v = a
assert a.s.z.x.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: C = None
        self.z: C = None
        self.v: F = None
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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

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