class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: B = None
        self.t: F = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: D = None
        self.txt = txt

n = A("n")
c = B("c")
h = C("h")
l = D("l")
f = E("f")
a = F("a")

n.z = c
n.p = c
n.t = a
n.w = l
c.p = h
c.o = h
c.t = n
c.w = f
c.x = l
h.v = a
h.t = a
h.s = l
h.y = n
h.x = f
l.z = c
l.r = c
l.w = f
l.x = f
f.x = n
f.v = h
f.p = l
a.z = l
a.s = l
assert f.p.w.p.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: B = None
        self.t: F = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: D = None
        self.txt = txt

n = A("n")
c = B("c")
h = C("h")
l = D("l")
f = E("f")
a = F("a")

n.z = c
n.p = c
n.t = a
n.w = l
c.p = h
c.o = h
c.t = n
c.w = f
c.x = l
h.v = a
h.t = a
h.s = l
h.y = n
h.x = f
l.z = c
l.r = c
l.w = f
l.x = f
f.x = n
f.v = h
f.p = l
a.z = l
a.s = l
assert f.p.w.p.z.t.txt == "n"