class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: D = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: F = None
        self.q: E = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

k.v = d
k.q = d
k.y = e
a.u = e
a.p = n
a.q = i
a.x = d
e.v = n
e.w = n
e.s = n
e.y = d
e.p = a
e.x = i
d.x = k
d.s = n
i.p = d
i.y = a
i.o = a
n.z = e
n.w = e
n.u = k
n.q = k
n.o = i
assert a.p.w.y.x.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: D = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: F = None
        self.q: E = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

k.v = d
k.q = d
k.y = e
a.u = e
a.p = n
a.q = i
a.x = d
e.v = n
e.w = n
e.s = n
e.y = d
e.p = a
e.x = i
d.x = k
d.s = n
i.p = d
i.y = a
i.o = a
n.z = e
n.w = e
n.u = k
n.q = k
n.o = i
assert a.p.w.y.x.q.x.txt == "k"