class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: C = None
        self.s: E = None
        self.x: B = None
        self.o: D = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

b = A("b")
l = B("l")
e = C("e")
i = D("i")
m = E("m")
a = F("a")

b.t = a
b.w = e
b.s = m
b.r = m
b.x = l
b.o = i
l.w = e
l.x = a
l.s = a
e.u = i
i.z = m
i.v = e
i.p = b
m.p = i
a.p = m
a.x = b
assert m.p.p.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: C = None
        self.s: E = None
        self.x: B = None
        self.o: D = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

b = A("b")
l = B("l")
e = C("e")
i = D("i")
m = E("m")
a = F("a")

b.t = a
b.w = e
b.s = m
b.r = m
b.x = l
b.o = i
l.w = e
l.x = a
l.s = a
e.u = i
i.z = m
i.v = e
i.p = b
m.p = i
a.p = m
a.x = b
assert m.p.p.o.z.txt == "m"