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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.u: F = None
        self.v: B = None
        self.txt = txt

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

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

k = A("k")
b = B("b")
j = C("j")
i = D("i")
c = E("c")
a = F("a")

k.s = c
k.q = c
k.z = j
k.y = j
k.r = b
b.x = k
b.p = j
j.y = i
i.y = j
i.x = k
i.u = a
i.v = b
c.p = b
a.z = k
a.x = k
a.s = b
assert i.v.x.z.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: C = None
        self.y: C = None
        self.r: B = None
        self.q: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.u: F = None
        self.v: B = None
        self.txt = txt

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

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

k = A("k")
b = B("b")
j = C("j")
i = D("i")
c = E("c")
a = F("a")

k.s = c
k.q = c
k.z = j
k.y = j
k.r = b
b.x = k
b.p = j
j.y = i
i.y = j
i.x = k
i.u = a
i.v = b
c.p = b
a.z = k
a.x = k
a.s = b
assert i.v.x.z.y.x.txt == "k"