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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: A = None
        self.x: B = None
        self.s: C = None
        self.q: A = None
        self.txt = txt

e = A("e")
i = B("i")
m = C("m")
d = D("d")
f = E("f")
k = F("k")

e.o = f
e.t = k
i.y = f
i.r = d
i.s = e
m.y = i
m.o = i
m.w = k
d.w = f
d.r = f
d.p = k
f.v = m
f.o = e
f.w = d
f.z = d
k.o = e
k.v = e
k.q = e
k.x = i
k.s = m
assert k.x.y.w.r.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: A = None
        self.x: B = None
        self.s: C = None
        self.q: A = None
        self.txt = txt

e = A("e")
i = B("i")
m = C("m")
d = D("d")
f = E("f")
k = F("k")

e.o = f
e.t = k
i.y = f
i.r = d
i.s = e
m.y = i
m.o = i
m.w = k
d.w = f
d.r = f
d.p = k
f.v = m
f.o = e
f.w = d
f.z = d
k.o = e
k.v = e
k.q = e
k.x = i
k.s = m
assert k.x.y.w.r.v.w.txt == "k"