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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

k = A("k")
d = B("d")
l = C("l")
m = D("m")
i = E("i")
j = F("j")

k.z = i
k.w = l
k.p = m
d.w = k
l.s = m
l.o = d
l.y = j
m.t = j
i.x = j
i.v = j
j.w = i
assert j.w.v.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: C = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

k = A("k")
d = B("d")
l = C("l")
m = D("m")
i = E("i")
j = F("j")

k.z = i
k.w = l
k.p = m
d.w = k
l.s = m
l.o = d
l.y = j
m.t = j
i.x = j
i.v = j
j.w = i
assert j.w.v.w.x.txt == "j"