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

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

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

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

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

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

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

n.v = f
m.t = f
m.p = n
m.q = n
m.w = n
g.w = l
g.u = l
g.v = l
g.x = n
g.t = e
l.v = m
l.o = f
l.w = n
e.x = g
e.v = g
e.t = n
e.o = l
e.z = m
f.s = l
f.w = e
f.p = e
f.x = e
f.v = a
a.t = f
a.p = n
a.q = n
a.w = n
assert e.o.w.v.w.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

n.v = f
m.t = f
m.p = n
m.q = n
m.w = n
g.w = l
g.u = l
g.v = l
g.x = n
g.t = e
l.v = m
l.o = f
l.w = n
e.x = g
e.v = g
e.t = n
e.o = l
e.z = m
f.s = l
f.w = e
f.p = e
f.x = e
f.v = a
a.t = f
a.p = n
a.q = n
a.w = n
assert e.o.w.v.w.v.x.txt == "n"