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

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

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

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

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

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

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

a.v = e
c.v = g
c.o = g
c.r = e
c.w = e
c.s = m
j.r = m
j.t = a
j.p = g
n.s = a
n.t = a
n.p = j
n.o = l
e.w = a
l.y = n
l.v = n
l.w = j
g.v = c
g.o = c
g.r = e
g.w = e
g.s = l
m.y = n
m.v = n
m.w = j
assert m.v.s.v.w.v.w.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

a.v = e
c.v = g
c.o = g
c.r = e
c.w = e
c.s = m
j.r = m
j.t = a
j.p = g
n.s = a
n.t = a
n.p = j
n.o = l
e.w = a
l.y = n
l.v = n
l.w = j
g.v = c
g.o = c
g.r = e
g.w = e
g.s = l
m.y = n
m.v = n
m.w = j
assert m.v.s.v.w.v.w.v.w.txt == "a"