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

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: E = None
        self.t: F = None
        self.p: F = None
        self.txt = txt

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

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

k = A("k")
l = B("l")
m = C("m")
i = D("i")
n = E("n")
a = F("a")
f = C("f")

k.z = l
k.x = a
k.o = a
k.y = a
l.p = m
m.o = l
m.w = f
m.z = k
m.r = i
i.x = k
i.s = n
i.t = a
i.p = a
n.q = f
n.y = f
n.o = k
a.z = k
a.p = m
f.o = l
f.w = m
f.z = k
f.r = i
assert l.p.w.w.r.t.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: F = None
        self.o: F = None
        self.y: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: E = None
        self.t: F = None
        self.p: F = None
        self.txt = txt

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

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

k = A("k")
l = B("l")
m = C("m")
i = D("i")
n = E("n")
a = F("a")
f = C("f")

k.z = l
k.x = a
k.o = a
k.y = a
l.p = m
m.o = l
m.w = f
m.z = k
m.r = i
i.x = k
i.s = n
i.t = a
i.p = a
n.q = f
n.y = f
n.o = k
a.z = k
a.p = m
f.o = l
f.w = m
f.z = k
f.r = i
assert l.p.w.w.r.t.z.x.txt == "a"