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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: B = None
        self.o: E = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: B = None
        self.o: E = None
        self.s: F = None
        self.txt = txt

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

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

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

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

i.w = k
i.q = a
k.s = a
k.o = e
k.r = e
k.x = e
k.v = n
a.r = n
a.s = n
a.q = k
a.o = e
j.w = k
j.v = a
e.s = a
e.y = i
n.q = i
n.u = e
n.x = j
assert j.w.v.x.txt == "j"