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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: B = None
        self.p: B = None
        self.s: A = None
        self.txt = txt

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

k.z = c
k.s = j
k.r = j
j.z = c
j.p = k
j.v = n
j.t = n
c.z = i
c.r = i
n.r = i
n.t = k
h.t = n
h.z = i
i.y = h
i.o = j
i.p = j
i.s = k
assert n.t.z.z.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: B = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: B = None
        self.p: B = None
        self.s: A = None
        self.txt = txt

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

k.z = c
k.s = j
k.r = j
j.z = c
j.p = k
j.v = n
j.t = n
c.z = i
c.r = i
n.r = i
n.t = k
h.t = n
h.z = i
i.y = h
i.o = j
i.p = j
i.s = k
assert n.t.z.z.y.z.txt == "i"