class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: D = None
        self.s: D = None
        self.z: E = None
        self.o: F = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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