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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.v: B = None
        self.txt = txt

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

n = A("n")
a = B("a")
m = C("m")
j = D("j")
e = E("e")
l = F("l")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.v: B = None
        self.txt = txt

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

n = A("n")
a = B("a")
m = C("m")
j = D("j")
e = E("e")
l = F("l")

n.w = j
n.u = m
a.r = e
a.t = n
a.p = l
a.x = j
m.y = l
m.t = j
m.z = e
m.w = a
j.z = n
j.s = e
j.t = a
e.w = m
e.y = m
e.v = a
l.w = a
l.s = a
l.p = e
l.z = e
l.o = e
l.r = m
assert e.w.y.r.txt == "m"