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

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

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

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

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

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

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

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

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

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

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

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

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

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

m.u = n
m.x = k
m.y = f
b.u = f
b.z = f
b.o = k
n.q = m
n.w = b
k.w = m
k.s = n
f.s = b
e.x = f
e.t = f
e.y = k
e.q = m
assert b.o.w.y.txt == "f"