class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: D = None
        self.r: B = None
        self.s: C = None
        self.x: D = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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