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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.s: D = None
        self.w: F = None
        self.o: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: D = None
        self.q: D = None
        self.y: A = None
        self.v: B = None
        self.s: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.s: D = None
        self.w: F = None
        self.o: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: D = None
        self.q: D = None
        self.y: A = None
        self.v: B = None
        self.s: C = None
        self.txt = txt

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

l.z = m
l.y = f
k.s = l
k.p = m
n.v = k
e.r = k
e.y = k
e.s = m
e.w = f
e.o = f
a.v = l
a.o = n
a.r = k
f.u = k
f.v = k
f.z = e
f.q = m
f.y = l
f.s = n
m.r = k
m.y = k
m.s = e
m.w = f
m.o = f
assert f.u.s.z.o.y.z.txt == "m"