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

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

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

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

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

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

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

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

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

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

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

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

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

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

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