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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: C = None
        self.r: B = None
        self.x: E = None
        self.y: F = None
        self.txt = txt

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

k = A("k")
l = B("l")
b = C("b")
e = D("e")
j = E("j")
n = F("n")
d = E("d")

k.w = b
k.v = e
k.y = n
k.p = j
l.p = k
l.v = k
l.w = k
l.u = e
l.r = b
b.w = k
b.u = l
e.y = n
e.s = b
j.z = k
j.o = b
j.r = l
j.x = d
j.y = n
n.p = b
d.z = k
d.o = b
d.r = l
d.x = j
d.y = n
assert k.v.s.w.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: D = None
        self.y: F = None
        self.p: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: C = None
        self.r: B = None
        self.x: E = None
        self.y: F = None
        self.txt = txt

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

k = A("k")
l = B("l")
b = C("b")
e = D("e")
j = E("j")
n = F("n")
d = E("d")

k.w = b
k.v = e
k.y = n
k.p = j
l.p = k
l.v = k
l.w = k
l.u = e
l.r = b
b.w = k
b.u = l
e.y = n
e.s = b
j.z = k
j.o = b
j.r = l
j.x = d
j.y = n
n.p = b
d.z = k
d.o = b
d.r = l
d.x = j
d.y = n
assert k.v.s.w.w.w.w.w.txt == "k"