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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

i = A("i")
l = B("l")
n = C("n")
k = D("k")
c = E("c")
b = F("b")

i.z = c
i.y = k
i.x = k
l.x = c
l.w = k
n.w = k
k.z = n
k.r = l
k.o = l
k.x = c
c.t = i
b.x = i
assert k.r.x.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: D = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

i = A("i")
l = B("l")
n = C("n")
k = D("k")
c = E("c")
b = F("b")

i.z = c
i.y = k
i.x = k
l.x = c
l.w = k
n.w = k
k.z = n
k.r = l
k.o = l
k.x = c
c.t = i
b.x = i
assert k.r.x.t.y.txt == "k"