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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: B = None
        self.w: E = None
        self.o: A = None
        self.txt = txt

a = A("a")
m = B("m")
l = C("l")
b = D("b")
i = E("i")
f = F("f")
d = E("d")
c = D("c")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: B = None
        self.w: E = None
        self.o: A = None
        self.txt = txt

a = A("a")
m = B("m")
l = C("l")
b = D("b")
i = E("i")
f = F("f")
d = E("d")
c = D("c")

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