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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

m = A("m")
i = B("i")
b = C("b")
n = D("n")
d = E("d")
c = F("c")
e = E("e")

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

m = A("m")
i = B("i")
b = C("b")
n = D("n")
d = E("d")
c = F("c")
e = E("e")

m.x = i
m.v = n
m.p = e
i.v = e
b.y = c
b.s = i
n.x = b
d.x = i
d.o = c
d.v = c
d.p = n
d.w = e
c.q = n
c.p = n
c.w = b
c.v = b
c.z = d
c.o = m
e.x = i
e.o = c
e.v = c
e.p = n
e.w = d
assert c.z.x.v.p.x.s.v.txt == "e"