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

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

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

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

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

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

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

m.y = d
m.t = a
m.v = e
m.u = l
l.p = f
l.q = f
n.q = l
n.y = m
n.t = a
n.s = f
n.z = d
f.q = a
e.r = d
e.s = a
e.x = m
a.y = m
a.x = l
a.p = n
d.q = l
d.y = m
d.t = a
d.s = f
d.z = n
assert m.v.s.y.y.y.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: F = None
        self.v: E = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

m.y = d
m.t = a
m.v = e
m.u = l
l.p = f
l.q = f
n.q = l
n.y = m
n.t = a
n.s = f
n.z = d
f.q = a
e.r = d
e.s = a
e.x = m
a.y = m
a.x = l
a.p = n
d.q = l
d.y = m
d.t = a
d.s = f
d.z = n
assert m.v.s.y.y.y.v.s.txt == "a"