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

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

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

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

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

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

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

m.w = n
m.t = f
m.u = k
f.r = n
f.t = n
f.o = k
f.z = i
e.r = m
k.y = f
k.r = n
k.z = e
n.w = m
n.s = k
n.v = i
i.y = n
i.z = e
i.x = f
assert m.w.s.y.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: B = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

m.w = n
m.t = f
m.u = k
f.r = n
f.t = n
f.o = k
f.z = i
e.r = m
k.y = f
k.r = n
k.z = e
n.w = m
n.s = k
n.v = i
i.y = n
i.z = e
i.x = f
assert m.w.s.y.o.y.txt == "f"