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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: A = None
        self.u: C = None
        self.r: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: B = None
        self.q: E = None
        self.txt = txt

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

e.z = b
e.q = j
b.q = j
b.s = e
b.u = i
b.r = k
i.w = k
i.z = k
i.p = n
i.u = e
j.x = i
j.v = k
j.z = k
k.s = j
n.z = k
n.q = k
n.t = b
assert b.s.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: A = None
        self.u: C = None
        self.r: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: B = None
        self.q: E = None
        self.txt = txt

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

e.z = b
e.q = j
b.q = j
b.s = e
b.u = i
b.r = k
i.w = k
i.z = k
i.p = n
i.u = e
j.x = i
j.v = k
j.z = k
k.s = j
n.z = k
n.q = k
n.t = b
assert b.s.q.x.txt == "i"