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

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

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

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

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

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

n = A("n")
e = B("e")
j = C("j")
a = D("a")
h = E("h")
f = F("f")

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

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

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

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

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

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

n = A("n")
e = B("e")
j = C("j")
a = D("a")
h = E("h")
f = F("f")

n.t = f
n.x = f
n.z = f
n.w = e
n.y = a
n.q = j
e.o = f
e.p = f
e.r = h
j.x = n
j.y = a
j.s = h
j.w = e
a.p = e
h.r = n
h.z = n
h.x = n
h.v = j
f.y = n
f.t = n
f.x = e
assert n.w.p.x.o.x.txt == "e"