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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: A = None
        self.v: C = None
        self.r: A = None
        self.t: B = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: E = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: A = None
        self.v: C = None
        self.r: A = None
        self.t: B = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: E = None
        self.v: E = None
        self.txt = txt

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

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