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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: E = None
        self.u: E = None
        self.t: F = None
        self.txt = txt

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

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

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

b = A("b")
l = B("l")
m = C("m")
h = D("h")
e = E("e")
f = F("f")

b.p = m
b.z = l
l.t = m
l.y = m
l.r = m
l.u = e
l.z = f
m.x = b
m.z = e
m.u = e
m.t = f
h.o = m
h.v = b
h.s = e
e.p = b
e.v = b
e.t = h
f.s = b
f.o = m
assert m.x.p.t.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: E = None
        self.u: E = None
        self.t: F = None
        self.txt = txt

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

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

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

b = A("b")
l = B("l")
m = C("m")
h = D("h")
e = E("e")
f = F("f")

b.p = m
b.z = l
l.t = m
l.y = m
l.r = m
l.u = e
l.z = f
m.x = b
m.z = e
m.u = e
m.t = f
h.o = m
h.v = b
h.s = e
e.p = b
e.v = b
e.t = h
f.s = b
f.o = m
assert m.x.p.t.s.p.txt == "m"