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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: E = None
        self.x: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: C = None
        self.r: C = None
        self.p: D = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: E = None
        self.x: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: C = None
        self.r: C = None
        self.p: D = None
        self.z: D = None
        self.txt = txt

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

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