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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: E = None
        self.t: E = None
        self.u: C = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

l = A("l")
k = B("k")
e = C("e")
d = D("d")
f = E("f")
m = F("m")

l.w = e
l.p = e
l.s = d
k.s = d
e.o = m
e.s = l
e.y = l
e.w = f
e.u = f
d.z = e
d.w = f
d.u = k
f.p = d
f.v = m
m.o = d
m.q = d
m.v = f
m.t = f
m.p = f
m.u = e
assert e.w.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: C = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: E = None
        self.t: E = None
        self.u: C = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

l = A("l")
k = B("k")
e = C("e")
d = D("d")
f = E("f")
m = F("m")

l.w = e
l.p = e
l.s = d
k.s = d
e.o = m
e.s = l
e.y = l
e.w = f
e.u = f
d.z = e
d.w = f
d.u = k
f.p = d
f.v = m
m.o = d
m.q = d
m.v = f
m.t = f
m.p = f
m.u = e
assert e.w.p.z.txt == "e"