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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: B = None
        self.t: D = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: B = None
        self.t: D = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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